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
 General SQL Server Forums
 New to SQL Server Programming
 LEGACY DOB

Author  Topic 

moiseszaragoza
Starting Member

8 Posts

Posted - 2009-06-27 : 21:18:30
Hi, I have been given a legacy DB and i dont know what to do to bring it up to date.

Well I have a "DOB" Field that is just wrong. I have 08/22/1983, and 08-22-1983, AND Agu 22, 1983

Just to give a example

When I did a SELECT DISTINCT DOB FROM TABLE i got 2000 + Diferent dates.

But how can i make all the dates have a standar?

Just keep smiling

Just keep smiling

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-06-28 : 00:39:28
you need to convert the current varchar values to standard datetimeformat. try the below

SELECT columns...
FROM
(
SELECT CONVERT(datetime,YourField) AS StandardDate,...other fields
FROM yourtable
)t
GROUP BY StandardDate
Go to Top of Page
   

- Advertisement -