DBAsupport.com Forums - Powered by vBulletin
Results 1 to 2 of 2

Thread: Fiscal Year Query Condition

  1. #1
    Join Date
    Mar 2004
    Posts
    55

    Fiscal Year Query Condition

    I am trying to place a condition in my query that would limit the date range on a particular date field to data from the start of my fiscal year (1st July 2006) and now.

    The 'now' part is easy because I would specify something like sysdate as my upper limit but I cannot get the 1 July 2006 without hardcoding it in my query.

    I am fundamentally looking at some date arithmetic and I though of using add_months or something similar but cannot work it out.

    I cannot use a parameter.

    I am supprised Oracle have not built in something for the fiscal year. I am using oracle 9i so i am unsure if 10g has something.

  2. #2
    Join Date
    Mar 2007
    Location
    Ft. Lauderdale, FL
    Posts
    3,555
    Think a litle more
    Here is a hint:
    -- the "year" part solution includes the words "sysdate" and "minus"
    -- the "day" and "month" part of the solution includes the word "constant"
    Pablo (Paul) Berzukov

    Author of Understanding Database Administration available at amazon and other bookstores.

    Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width