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