Get day of week in CR based on current date.

Posted on 2011-04-29
Medium Priority
Last Modified: 2012-05-11
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!
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

Author Comment

ID: 35490850
Thanks!  Trying it now!
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.


Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

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

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question