Formula to differentiate beween week and weekend

Posted on 2012-08-31
Last Modified: 2012-08-31
I need to create a formula that can distinguish between days from Monday 09:00 to Friday 14:59:59 - display "Week rate : $12,00" and Friday 15:00 to Monday 08:59:59 - display "Weekend rate : $10,00"
Question by:John-S Pretorius
    LVL 100

    Accepted Solution

    Try this

    If DayofWeek({YourDateField}) IN [3,4,5] then
        "Week rate: $12.00"
    Else if DayofWeek({YourDateField}) IN [1,7] then
        "Weekend Rate: $10.00"
    Else if DayofWeek({YourDateField}) = 6 then
          If Time({YourDateField}) < Time(15,0,0) then
              "Week rate: $12.00"
             "Weekend Rate: $10.00"
          If Time({YourDateField}) >= Time(9,0,0) then
              "Week rate: $12.00"
             "Weekend Rate: $10.00"


    Author Comment

    by:John-S Pretorius
    Thank you so much, great work as always.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Threat Intelligence Starter Resources

    Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

    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 …
    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…
    Hi everyone! This is Experts Exchange customer support.  This quick video will show you how to change your primary email address.  If you have any questions, then please Write a Comment below!
    This video discusses moving either the default database or any database to a new volume.

    761 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

    9 Experts available now in Live!

    Get 1:1 Help Now