Author |
Message |
fairy princess
Newbie
Joined: 15 Aug 2008
Location: United Kingdom
Online Status: Offline
Posts: 21
|
Topic: excluded weekends Posted: 20 Jan 2009 at 8:07am |
|
Many Thanks the tooth fairy
|
IP Logged |
|
AntDC
Groupie
Joined: 23 Dec 2008
Online Status: Offline
Posts: 76
|
Posted: 20 Jan 2009 at 8:32am |
Check the value using the DayOfWeek function in the formula editor and suppress accordingly.
HTH
DC
|
IP Logged |
|
DBlank
Moderator
Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
|
Posted: 20 Jan 2009 at 8:45am |
if you want to exclude that data from your report altogether use a select statement of:
weekday({table.datefield}) in 1 to 5
|
IP Logged |
|
fairy princess
Newbie
Joined: 15 Aug 2008
Location: United Kingdom
Online Status: Offline
Posts: 21
|
Posted: 22 Jan 2009 at 6:31am |
ive tryed using datediff nothing is working any more help.
ReceivedDate Results_Given
|
Many Thanks the tooth fairy
|
IP Logged |
|
DBlank
Moderator
Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
|
Posted: 22 Jan 2009 at 7:42am |
Hi TF,
Just to clarify, do you want to suppress fields that are Sat or Sun or do you want to exclude them from your report.
If you want to eclude them altogther did you try the formula I gave you?
weekday({yourtable.yourdatefield}) in 1 to 5
This would exclude all Sat or Sun dates from yuor report.
Please give more info if this is not what you want to do.
Thanks
|
IP Logged |
|
fairy princess
Newbie
Joined: 15 Aug 2008
Location: United Kingdom
Online Status: Offline
Posts: 21
|
Posted: 22 Jan 2009 at 7:52am |
what i need to do is run a report to show how long pps have to wait for results but weekends do not count as days they have waited
|
Many Thanks the tooth fairy
|
IP Logged |
|
DBlank
Moderator
Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
|
Posted: 22 Jan 2009 at 8:00am |
From Crystal Online Help:
For example, suppose you want to calculate the number of days between the order date and ship date, excluding Saturdays and Sundays:
Rem Basic syntax
Dim d1, d2
d1 = {Orders.Order Date}
d2 = {Orders.Ship Date}
formula = DateDiff("d", d1, d2) - _
DateDiff("ww", d1, d2, crSaturday) - _
DateDiff("ww", d1, d2, crSunday)
//Crystal syntax
Local DateTimeVar d1 := {Orders.Order Date};
Local DateTimeVar d2 := {Orders.Ship Date};
DateDiff ("d", d1, d2) -
DateDiff ("ww", d1, d2, crSaturday) -
DateDiff ("ww", d1, d2, crSunday)
|
IP Logged |
|
DBlank
Moderator
Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
|
Posted: 22 Jan 2009 at 8:06am |
FYI- looks like my other syntax was wrong in case you need it for future reference. I forgot it defaults to Sunday as "1" so it would have needed to be set to Monday=1 like:
weekday({yourtable.yourdatefield},crMonday) in 1 to 5
|
IP Logged |
|
fairy princess
Newbie
Joined: 15 Aug 2008
Location: United Kingdom
Online Status: Offline
Posts: 21
|
Posted: 22 Jan 2009 at 8:08am |
its asking for date not sure where to put them
|
Many Thanks the tooth fairy
|
IP Logged |
|
DBlank
Moderator
Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
|
Posted: 22 Jan 2009 at 8:11am |
In teh formula replace
{Orders.Order Date} with your startdate field
{Orders.Ship Date} with your enddate field
for the two fields you need to calculate the difference between.
|
IP Logged |
|
|