May 18, 2010 at 6:49 am
I have a table from where i need to retrieve data when datecol < todays date how to do??
I am writing query as
"SELECT * FROM TEMPTABLE where TableId=30 AND DAYField < GETDATE()"
but it is displaying even today's data.
Please somebody help me.
May 18, 2010 at 6:52 am
Time is intrinsic to the date time type. Please read this... http://www.karaszi.com/SQLServer/info_datetime.asp
May 18, 2010 at 7:07 am
use
DayField < CONVERT(VARCHAR(10),GETDATE(),101)
for correct results
May 18, 2010 at 7:38 am
Thanks Gopi Muluka
It worked perfet. Thanks alot
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply