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
 Other Forums
 MS Access
 converting varchar field to date

Author  Topic 

ravenhawk08
Starting Member

8 Posts

Posted - 2009-05-26 : 15:22:39
Help!.. I have a field in a database table that is formatted as nvarchar. I need to convert this field to a date. I'm using SQL server 2000.

I've tried the following command:
select convert(datetime,report_date,1)as print_date

I get this error message:
Syntax error converting datetime from character string

Any insight you can provide would be appreciated.

Thank you

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2009-05-26 : 16:35:00
See first which records has values for report_date column which cannot be interpreted as a date at all.

SELECT * FROM Table1
WHERE ISDATE(report_date) = 0



E 12°55'05.63"
N 56°04'39.26"
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2009-05-27 : 02:32:44
Are the dates stored in any format?

Madhivanan

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

- Advertisement -