|
tbiggi -> Web Report for advertisements in the past week - need to identify weekdays vs weekends (6/4/2008 11:47:50 AM)
|
Here is a report that shows advertisments with a start date within the past seven days. The query for the report is: select distinct PresentTime as AdvertisementStartTime, OfferID as AdvertisementID, OfferName as AdvertisementName, PkgID from dbo.vOfferStatusSummarizerRoot where PresentTime >= (GETDATE() - 7) order by PresentTime Desc and it is setup with a link (drill down) to report 111 (Status of a specific advertisment). For those reports within the past seven days we create and send out status reports on day 1, day 3 and day 5 after the start day. This will eventually be tied in with a SQL job to automatically generate the report and email it out but I only want that to occur on weekdays and not on weekends. The challenge is to determine if that day 1,2 or 3 falls on a weekend day and if it does, pick the next weekday. How can that be accomplished in TSQL or WSQL (I'd like to add the Day 1/3/5 days/dates to the web report as well)?
|
|
|
|