Skip to Content
author's profile photo Former Member
Former Member

Calculate Quarter within Date Range

I have question regarding a date range. I created a formula like so

{SO_SalesOrderHistoryHeader.OrderDate} >=DateValue (2008,04,01) and {SO_SalesOrderHistoryHeader.OrderDate}<=DateValue (2008,06,30)

I get my "True" which is fine, my problem is, what happens when it goes to the next year? Or I want to look at a previous year? Do I have to go back and edit my formula?

Or is there a way to tell my formula to go by whatever year is entered?

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jan 13, 2009 at 09:21 PM

    Well, you can have a parameter to input the year and then use it in your formula so that no matter what the value of the year, your formula will still work. Make the parameter for the year of type Number.

    {SO_SalesOrderHistoryHeader.OrderDate} >=DateValue ({?Year Parameter},04,01) and {SO_SalesOrderHistoryHeader.OrderDate}<=DateValue ({?Year Parameter},06,30)

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Awesome! That works! I appreciate your help on this.

      Do you think there is a way to pull the year that is entered through this parameter?

      I figured I would tell it what quarter it was in how do I add what year it is too?

      if {SO_SalesOrderHistoryHeader.OrderDate} >=DateValue (year(minimum({?Date})) ,01,01) and {SO_SalesOrderHistoryHeader.OrderDate}<=DateValue (year(minimum({?Date})) ,03,31) then

      "Quarter 1"

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.