Solved

# Get day of week in CR based on current date.

Posted on 2011-04-29
Medium Priority
397 Views
Hello experts.  Here is what I need to do, I need to evaluate what the current day is.  So, basically something like this

If CurrentDate = Monday Then
Do something
Else If CurrentDate = Tuesday Then
Do something
etc., etc.

Can anyone tell me how to go about doing this.  Thanks!
0
Question by:jwebster77

LVL 77

Accepted Solution

peter57r earned 2000 total points
ID: 35490822
Sunday is day 1...

if dayofweek(currentdate) = 2  then    //monday
.......
else if dayofweek(currentdate) = 3 then     //tuesday
....
0

Author Comment

ID: 35490850
Thanks!  Trying it now!
0

LVL 35

Expert Comment

ID: 35490929
Peter beat me to it.  I'll just add that you can also add a second argument to DayOfWeek if you want the week to start on some day besides Sunday.  For example, DayOfWeek (CurrentDate, crTuesday).  crMonday, crTuesday, etc. are CR constants for the day numbers.  Or, you can just use 1, 2, etc.

James
0

## Featured Post

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…
###### Suggested Courses
Course of the Month13 days, 19 hours left to enroll