Get day of week in CR based on current date.

Posted on 2011-04-29
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

    Sunday is day 1...

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

    Author Comment

    Thanks!  Trying it now!
    LVL 34

    Expert Comment

    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.


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Free Trending Threat Insights Every Day

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Suggested Solutions

    I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
    There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

    759 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

    Need Help in Real-Time?

    Connect with top rated Experts

    12 Experts available now in Live!

    Get 1:1 Help Now