Here is what I used and it still failed with the same error. Did I do something wrong?


SELECT personid  
FROM persondemographic
WHERE  CASE RIGHT(demographicvaluedesc, 1)
WHEN
   'M'
THEN
   convert(datetime, demographicvaluedesc,109)
ELSE
   convert(datetime, demographicvaluedesc,101)
        END > getdate()
AND DemographicGroupId = 8
AND DemographicItemId = 4
ORDER BY demographicvaluedesc

-----Original Message-----
From: Philip Arnold [mailto:[EMAIL PROTECTED]
Sent: Friday, December 12, 2003 11:35 AM
To: CF-Talk
Subject: RE: SQL date conversion issue

WHERE CASE RIGHT(demographicvaluedesc, 1) WHEN 'M' THEN
convert(datetime, demographicvaluedesc, 109) ELSE convert(datetime,
demographicvaluedesc, 101) end > getdate()-1

What that does is if the date ends in an "M" (AM or PM) then use the
"mon dd yyyy hh:mi:ss:mmmAM (or PM)" conversion, otherwise use
"mm/dd/yy"

A complete list of the codes are here
http://msdn.microsoft.com/library/default.asp?url="">
/ts_ca-co_2f3o.asp

HTH
[
Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to