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
 SQL Server Development (2000)
 Error convert DateTime

Author  Topic 

dadunn
Yak Posting Veteran

67 Posts

Posted - 2001-08-10 : 18:11:35
This query has been working for several months and as of yesterday doesn't.

FROM Receipt a INNER JOIN ReceiptDetail b ON a.ReceiptKey = b.ReceiptKey

WHERE a.StorerKey = "SWH" AND
(b.Lottable01 = "Unassigned" OR
(b.Lottable01 = "" AND
b.QtyExpected > 0 AND
b.QtyReceived = 0))AND
GetDate() >= Convert(datetime,a.VehicleNumber) AND
GetDate() < Convert(datetime,a.PlaceOfLoading) AND
SKU IN ( SELECT DISTINCT SKU
FROM SWH_Drop_Unprocessed) AND
SKU IS NOT Null

I get this error:

Server: Msg 241, Level 16, State 1, Line 1
Syntax error converting datetime from character string.

I can convert the dates in the select statement jsu fine, but when I try to compare it to getdate() I get the error.

Any ideas?

Thanks

Dave

   

- Advertisement -