charliemopps
Registered User.
- Local time
- Yesterday, 23:36
- Joined
- Feb 24, 2009
- Messages
- 40
I have a list of stuff that I have to querry on a Linux based server. Each file is named by date, and the stuff I want could be on the date listed in my report or on either the prior or 2 days after due to GMT and other wishy washy stuff.
So what I want is to have a list of dates + 1day prior to the first date, and the 2 dates after the last date. Also if there is a break in the dates I need the 2 dates after both the last dates.
Example, my table has the following dates
4/20/2010
4/21/2010
4/22/2010
5/15/2010
4/16/2010
I'd like the output to be:
4/19/2010
4/20/2010
4/21/2010
4/22/2010
4/23/2010
4/24/2010
5/14/2010
5/15/2010
4/16/2010
5/17/2010
5/18/2010
So I can then build my Grep command with that.
I have the SQL to sort and limit the dates for me but I don't know how to add the extra dates. Any ideas?
So what I want is to have a list of dates + 1day prior to the first date, and the 2 dates after the last date. Also if there is a break in the dates I need the 2 dates after both the last dates.
Example, my table has the following dates
4/20/2010
4/21/2010
4/22/2010
5/15/2010
4/16/2010
I'd like the output to be:
4/19/2010
4/20/2010
4/21/2010
4/22/2010
4/23/2010
4/24/2010
5/14/2010
5/15/2010
4/16/2010
5/17/2010
5/18/2010
So I can then build my Grep command with that.
I have the SQL to sort and limit the dates for me but I don't know how to add the extra dates. Any ideas?
Code:
SELECT CDate(Int([Dateof])) AS Expr1
FROM Tbl_Reports
WHERE (((Tbl_Reports.Ticket)=0) AND ((Tbl_Reports.Dateof) Is Not Null))
GROUP BY CDate(Int([Dateof]))
ORDER BY CDate(Int([Dateof]));