It looks like the value in the field isn't a valid "date"

Are any of the entries NULL? That can cause problems too for conversions
like this

> -----Original Message-----
> From: Eric Creese [mailto:[EMAIL PROTECTED]
> Sent: Friday, December 12, 2003 10:17 AM
> To: CF-Talk
> Subject: SQL date conversion issue
>
>
> Any pointers here. I have a varchar field that holds a date
> value. I need to pull records where the date has yet to expire.
>
> If I run this query, it runs fine.
>
> SELECT * FROM Persondemographic
> WHERE DemographicGroupId = 8
> AND DemographicItemId = 4
> AND convert (datetime,demographicvaluedesc)> getdate()-1
>
>
> However I need to run this query and it errors with "Server:
> Msg 241 - Syntax error converting datetime from character string."
>
> SELECT personid FROM Persondemographic
> WHERE DemographicGroupId = 8
> AND DemographicItemId = 4
> AND convert (datetime,demographicvaluedesc)> getdate()-1
>
>
> any help would be appreciated
>
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to