TonyScarpelli
Programmer
I have a character field where the most of the dates are in the format 'Mar 8 2011 12:00AM', however, there are sometimes dates like this:
'April 1, 2009' or '06-2013' or '09/04/2009'.
I am trying to check to see if the date is a DATETIME and if it isn't to either skip the record or convert it into a DATETIME format.
Can I do something like this in a select statement:
IF CAST(MyTable.FIELD5 AS DATETIME) = DATETIME()
CAST(AIMS.EXPD.FIELD5 AS DATETIME) < @StartDate
ELSE
NewDate = CONVERT_TO_DATETIME(FIELD5)
IF NewDate < @StartDate
Thanks for any help on this.
Tony Scarpelli
Clinical Engineering Dept.
Maine Medical Center
Portland, Maine 04102
'April 1, 2009' or '06-2013' or '09/04/2009'.
I am trying to check to see if the date is a DATETIME and if it isn't to either skip the record or convert it into a DATETIME format.
Can I do something like this in a select statement:
IF CAST(MyTable.FIELD5 AS DATETIME) = DATETIME()
CAST(AIMS.EXPD.FIELD5 AS DATETIME) < @StartDate
ELSE
NewDate = CONVERT_TO_DATETIME(FIELD5)
IF NewDate < @StartDate
Thanks for any help on this.
Tony Scarpelli
Clinical Engineering Dept.
Maine Medical Center
Portland, Maine 04102