Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Slecting Data for Weekdays 2

Status
Not open for further replies.

Kmccormic

Technical User
Feb 13, 2009
20
0
0
US
Hi:
I'm trying to create a formula to either include only weekdays in a crosstab report, or exclude weekends. I want to trend call volume for staffing purposes. I have my data set up to have the data grouped by date (rows) and hourly by time of day in specified orde where I have sorted all the intervals in a specified order by hour (columns) (i.e. 8:00 = 8:00, 8:15, 8:30, 8:45, etc).

I've tried this formula below as a filter but it will only give me dates for 1 day of the week. I've tried using various forms and I can't use the simple "is one of" because the options given in the drop down give me every date in the year so far, not days of the week.

Works, gives me only those dates which are a Friday:
DayOfWeek ({iCDNStat.Timestamp}) = 6

Doesn't work:
DayOfWeek ({iCDNStat.Timestamp}) = 2 and
DayOfWeek ({iCDNStat.Timestamp}) = 3 and
DayOfWeek ({iCDNStat.Timestamp}) = 4 and
DayOfWeek ({iCDNStat.Timestamp}) = 5 and
DayOfWeek ({iCDNStat.Timestamp}) = 6

Doesn't work
suppress if DayOfWeek ({iCDNStat.Timestamp}) = 1 or DayOfWeek ({iCDNStat.Timestamp}) = 7

Doesn't work
DayOfWeek ({iCDNStat.Timestamp}) = 2 to
DayOfWeek ({iCDNStat.Timestamp}) = 6

I'm using Crystal reports 2008. Any advice welcome!
 
Doesn't work:
DayOfWeek ({iCDNStat.Timestamp}) = 2 and
DayOfWeek ({iCDNStat.Timestamp}) = 3 and
DayOfWeek ({iCDNStat.Timestamp}) = 4 and
DayOfWeek ({iCDNStat.Timestamp}) = 5 and
DayOfWeek ({iCDNStat.Timestamp}) = 6

Try replacing AND with OR. Logically, you can't have a timestamp be 2 AND 3 AND 4, etc.

 
DayOfWeek ({iCDNStat.Timestamp}) in 2 to 6

-LB
 
lbass and Turkbear just helped me out with defining business days which it sounds like you are trying to do.

The FAQ that outlines how to do this is located here:
FAQ767-4465
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top