Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Technical Questions
Message Icon Topic: excluded weekends Post Reply Post New Topic
Page  of 2 Next >>
Author Message
fairy princess
Newbie
Newbie
Avatar

Joined: 15 Aug 2008
Location: United Kingdom
Online Status: Offline
Posts: 21
Quote fairy princess Replybullet Topic: excluded weekends
    Posted: 20 Jan 2009 at 8:07am
CryCryCry help i need to write a report that will not encluded sat and sunday in a day waiting any help
Many Thanks the tooth fairy
IP IP Logged
AntDC
Groupie
Groupie
Avatar

Joined: 23 Dec 2008
Online Status: Offline
Posts: 76
Quote AntDC Replybullet Posted: 20 Jan 2009 at 8:32am
Check the value using the DayOfWeek function in the formula editor and suppress accordingly.

HTH

DC
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet 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 IP Logged
fairy princess
Newbie
Newbie
Avatar

Joined: 15 Aug 2008
Location: United Kingdom
Online Status: Offline
Posts: 21
Quote fairy princess Replybullet 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 IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet 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 IP Logged
fairy princess
Newbie
Newbie
Avatar

Joined: 15 Aug 2008
Location: United Kingdom
Online Status: Offline
Posts: 21
Quote fairy princess Replybullet 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 IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet 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 IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet 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 IP Logged
fairy princess
Newbie
Newbie
Avatar

Joined: 15 Aug 2008
Location: United Kingdom
Online Status: Offline
Posts: 21
Quote fairy princess Replybullet Posted: 22 Jan 2009 at 8:08am
its asking for date not sure where to put them
Many Thanks the tooth fairy
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet 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 IP Logged
Page  of 2 Next >>
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.016 seconds.