Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2007
    Posts
    9

    Unanswered: Select Financial year

    How to write a select query for financial year? The financial is from 1st July to 30th June each year. Here's the pseudo code (dd-mm-yyyy):

    If extract(month from current_date) < 7 then

    select date between ('01-07-date_part('year', current_date)'-1) and ('30-06-date_part('year', current_date')')

    else

    select date between ('01-07-date_part('year', current_date)') and ('30-06-date_part('year', current_date')')

    End if

    Appreciate any help.

  2. #2
    Join Date
    Apr 2007
    Posts
    9
    Anybody ?

  3. #3
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    anyone? yeah, me...

    Select Financial year

    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

Posting Permissions

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