all groups > sql server mseq > august 2004 >
You're in the

sql server mseq

group:

finding records using a Date expresion


finding records using a Date expresion Bob
8/16/2004 10:59:24 AM
sql server mseq:
how do I find all records that were created before
today minus 150 days. I could easily do this in MsAccess
by doing the following

by filtering off of the Date created field using the
Re: finding records using a Date expresion Vishal Parkar
8/17/2004 1:59:33 AM
you can get today minus 150 days with the help of either of following
expression, 1st will not remove time component whereas 2nd will remove time
component from today's date and will go back 150 days.

getdate() - 150

--OR
(convert(datetime,convert(varchar(8),getdate(),112)) - 150)

--
Vishal Parkar
vgparkar@yahoo.co.in | vgparkar@hotmail.com

AddThis Social Bookmark Button