Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 DATE Coversion Question!

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2005-10-26 : 07:25:10
Andre writes "I have a a table called "Sales" and I want to take the values that look like: 20050920 in one

column called SalesDate and insert it into the second column called "RevDate" where each date

corresponds to the "Cust_ID"

Table: Sales

Cust_ID | RevDate | SalesDate
12534 20050920
12535 20050920
23774 20050418
19724 20050326

In a nutshell, put the "SaleDate" in this format 2005/09/20 into "RevDate" where it corresponds to

the "Cust_ID". SAo it should look like this:

Cust_ID | RevDate | SalesDate
12534 9/20/2005 20050920
12535 9/20/2005 20050920
23774 4/18/2005 20050418
19724 3/26/2005 20050326

Please help my write an SQL Query to get this done""

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-10-26 : 07:28:19
You can easily show this in your Front End application by formatting the date

Otherwise you need to use Convert function like this

select convert(varchar,getdate(),101)


Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -