myITforum.com Community Forum myITforum.com Community Forum

Home  Forums  Blogs  Live Support chat  Search Articles  Wiki  FAQ  Email Lists  Register  Login  My Profile  Inbox  Address Book  My Subscription  My Forums 

Photo Gallery  Member List  Search  Calendars  FAQ  Ticket List  Log Out

All Forums RSS Feed Subscription:


  


Web Report for advertisements in the past week - need to identify weekdays vs weekends

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
  Printable Version
All Forums >> [Management Products] >> Microsoft Systems Management Server >> Web Reporting >> Web Report for advertisements in the past week - need to identify weekdays vs weekends Page: [1]
Login
Message << Older Topic   Newer Topic >>
Web Report for advertisements in the past week - need t... - 6/4/2008 11:47:50 AM   
tbiggi

 

Posts: 59
Score: 1
Joined: 9/13/2001
Status: offline
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)?

Post #: 1
RE: Web Report for advertisements in the past week - ne... - 6/4/2008 7:13:34 PM   
jnelson993


Posts: 724
Score: 89
Joined: 2/18/2005
From: Minneapolis, MN
Status: offline
Well, in WQL...I don't know if you can, but in SQL you can use DATEPART and look for days between 2 (monday) and 6 (friday)

This will only return "Today is a weekday" if it actually is a weekday today.  Otherwise there will be no records returned.
SELECT
  'Today is a weekday'
WHERE
  DATEPART(WEEKDAY,getDate()) BETWEEN 2 AND 6


This will only return "Today is a weekend" if it actually is a weekend today.  Otherwise no records.
SELECT
  'Today is a weekend'
WHERE
  DATEPART(WEEKDAY,getDate()) IN (1,7)



_____________________________

Number2 (John Nelson)
MyITForum - Blog
MyITForum - Forum Posts

(in reply to tbiggi)
Post #: 2
Page:   [1]
All Forums >> [Management Products] >> Microsoft Systems Management Server >> Web Reporting >> Web Report for advertisements in the past week - need to identify weekdays vs weekends Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts



  
Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI

0.359