Print Page | Close Window

excluded weekends

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Technical Questions
Forum Discription: Formulas, charting data, Crystal syntax, etc.
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=5272
Printed Date: 03 May 2024 at 10:51pm


Topic: excluded weekends
Posted By: fairy princess
Subject: excluded weekends
Date 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



Replies:
Posted By: AntDC
Date Posted: 20 Jan 2009 at 8:32am
Check the value using the DayOfWeek function in the formula editor and suppress accordingly.

HTH

DC


Posted By: DBlank
Date 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


Posted By: fairy princess
Date 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


Posted By: DBlank
Date 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


Posted By: fairy princess
Date 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


Posted By: DBlank
Date Posted: 22 Jan 2009 at 8:00am
From Crystal Online Help:
 


Posted By: DBlank
Date 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


Posted By: fairy princess
Date Posted: 22 Jan 2009 at 8:08am
its asking for date not sure where to put them

-------------
Many Thanks the tooth fairy


Posted By: DBlank
Date 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.


Posted By: fairy princess
Date Posted: 22 Jan 2009 at 8:16am
i have done that so sorry not been using it that long

-------------
Many Thanks the tooth fairy


Posted By: DBlank
Date Posted: 22 Jan 2009 at 8:45am
That alright. I am  just getting a handle on using this type of formula myself but try this...
In a formula field copy this and replace the to date fields, drop it into your report to see the results and verify them.

Local DateTimeVar d1 := {YourBeginDateFieldHere};

Local DateTimeVar d2 := {YourEndDateFieldHere};

DateDiff ("d", d1, d2) -

     DateDiff ("ww", d1, d2, crSaturday) -

     DateDiff ("ww", d1, d2, crSunday)

 

If anyone else wants to correct my syntax please do as this is not my comfort zone Confused




Print Page | Close Window