Oct 14, 2002 #1 Grudge Programmer Jul 30, 2002 23 ZA It's easy doing a query to get the last x records from the data (they each have a date field) QUERY : select * from sourcetable order by date limit x But I need to get the records that were added the last x days ??
It's easy doing a query to get the last x records from the data (they each have a date field) QUERY : select * from sourcetable order by date limit x But I need to get the records that were added the last x days ??
Oct 14, 2002 #2 rt63 IS-IT--Management Aug 20, 2001 255 IN select * from sourcetable where datediff(dd,<date field>,getdate()) >= 8 order by date RT Upvote 0 Downvote
Oct 14, 2002 #3 rt63 IS-IT--Management Aug 20, 2001 255 IN I am sorry. By mistake, I wrote 8 instead of @x select * from sourcetable where datediff(dd,<date field>,getdate()) >= @x order by date RT Upvote 0 Downvote
I am sorry. By mistake, I wrote 8 instead of @x select * from sourcetable where datediff(dd,<date field>,getdate()) >= @x order by date RT
Oct 14, 2002 Thread starter #4 Grudge Programmer Jul 30, 2002 23 ZA Thanks, it works 100% Upvote 0 Downvote