Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9041365
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T10:13:24+00:00 2026-06-16T10:13:24+00:00

I need a financial year entries based on current or today’s date AND time

  • 0

I need a financial year entries based on current or today’s date AND time in Oracle11g DB.

Suppose if we consider today’s date is 1ST April 2013, then i need the outputs as 01-APR-13 and 31-MAR-14.

Our requirement financial Year considered is from April (the current year) to March (following year).

Based on current datetime…the scenario of output depends on the current date-time which falls in the above said period or duration.

Another example: If we take today’s datetime as 28th Dec 2012, then the output is needed as 01-APR-12 and 31-MAR-13.

Please help how to acheive the same in very short format using only SQL.

Consider the below table as

Create table venky (financialYearFrom DATE NOTNULL, financialYearTo DATE NOTNULL);
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T10:13:26+00:00Added an answer on June 16, 2026 at 10:13 am

    Something ugly:

       SELECT to_date('1-APR-'||(to_char(sysdate,'yyyy')+
                                    (case when to_char(sysdate,'mm')>3 
                                     then 0 
                                     else -1 
                                     end))) AS start_date ,
          to_date('31-MAR-'||(to_char(sysdate,'yyyy')+
                                     (case when to_char(sysdate,'mm')>3 
                                      then 1 
                                      else 0 
                                      end))) end_date 
       FROM dual;
    

    If month > 3 then add a year to 31-MAR(end_of_period), else substract a year to 1-APR (start_of_period).

    UPDATE: Something nicer:

    select add_months(trunc(add_months(sysdate,-3),'yyyy'),3) as start_date ,
        add_months(trunc(add_months(sysdate,-3),'yyyy'),15)-1 as end_date 
       from dual
    

    Substracting 3 months will send you to the correct start year. Truncating to year and adding 3 months sends you to 1 APR. End_of period is 12 months ahead start minus one day.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Our financial year starts at 1st of April of every year. Therefore the current
The following are the Quarters for a financial year April to June - Q1
ASP.NET using C# The following are the Quarters for the financial year 2011-12 April
We are building a Silverlight-based system in the financial domain. We need to push
I need to create this url: www.example.com/directory/[state]-financial-planners Where [state] will be different depending on
I need to extract financial price data from a binary file. This price data
I'm creating script for automated testing of financial application. Using VbScript as language. Need
Need to generate some financial report where the formatting is controlled by the data
I am on a project that involves processing financial information, and so I need
There's the need to send data to an external interface - a financial statutory

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.