Crystal 8.5 newb needs assistance (1 Viewer)

z00lander

New member
Local time
Yesterday, 21:51
Joined
Feb 6, 2009
Messages
2
I need to create 2 date formulas and don't quite know how to accomplish it. The first one needs to calculate tomorrows date unless it is Friday, then tomorrow would be Monday; weekends do not count. The other one needs to calculate 2 weeks from tomorrow and if it is Friday then it would be 2 weeks from the following Monday.
Does this all make sense? If you have any questions, please ask and thanks for any and all help.

Jerry
 

Kempes

Registered User.
Local time
Today, 03:51
Joined
Oct 7, 2004
Messages
327
Assuming your date field is the current date, try this. Create a new formula field and type....

select DayOfWeek (CurrentDate) case 6 : CurrentDate+3 default: CurrentDate+1

DayofWeek will return 1-7 depending on which day number the date equates to.
Currentdate + x will bring back whichever date you need.

You can adapt the same forumula to work out 2 weeks ahead too. Just increase the number you are adding to current date.

Hope this helps

Kempes
 

z00lander

New member
Local time
Yesterday, 21:51
Joined
Feb 6, 2009
Messages
2
How would I replace my current parameter fields with the formula that you suggested? You will have to forgive my ignorance.

Jerry
 

Kempes

Registered User.
Local time
Today, 03:51
Joined
Oct 7, 2004
Messages
327
if you have taken my code verbatim, then you probably won't be able to prompt on it as it is using currentdate. currentdate has no attachement to your database records, therefore cannot be used to return particular records from your db.

However, if you replace currentdate with a date field taken from your db, the formula should be available to choose as a parameter in your selection criteria.

eg

select DayOfWeek (yourdbdatefield) case 6 : yourdbdatefield+3 default: yourdbdatefield+1

it all depends on what you are trying to achieve.
 

Users who are viewing this thread

Top Bottom