mick burden
SSCarpal Tunnel
Points: 4432
More actions
April 14, 2007 at 8:31 am
#173420
I've a Table with several fields, one of which is a datetime field in whech is stored the date an entry was made to that table, my question is, how can I do a select all where the date is 4 weeks or less ago?
David Scotland-132255
SSCertifiable
Points: 5599
April 14, 2007 at 9:06 am
#700553
You could do something like
SELECT *
FROM Table
where datetime >= DATEADD(week, -4, GETDATE())
Obviously the use of getdate() may not be appropriate for you but hopefully you get the idea
hth
David
April 14, 2007 at 9:25 am
#700555
that's brilliant, thanks
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply