I need a Query for this (Bit Urgent)

  • Hi,

    I need a Query for calculating the fiscal_week based on the input dates (start_date and end_date), though I got a query from this forum, it is not giving me exact result.

    the sample is in the excel file with the attachment.

    In the excel:

    First tab tells you the raw_data what I am using to find the Fiscal_week

    Second tab tell you the data where i found the mistake, and how I am expecting the output.

    I also have attached the query I have got from this forum, query I have modified for fiscalweek

    kindly help me ASAP, as I need to produce the report Shortly.

  • If you want it urgently, then make it as easy as possible for someone to answer.

    Please provide the CREATE TABLE for all involved tables and the sample data as insert statements.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • Gail,

    to be simple, all I need is to calculate the fiscal week. on a fiscal year.

    start day of a week is saturday and ends on Friday.

    the query i got is not giving the week numbers

  • whats the fiscal year start date......the excel sheet gives differing dates?

    FISCAL_DATEFISCAL_MONTHFISCAL_QUARTERFiscal_Quarter_ShortFiscal_YearINTDATEObtained_FISCAL_WEEK

    29/04/20062007M012007Q1Q1200720060429WK1

    28/04/20072008M012008Q1Q1200820070428WK1

    26/04/20082009M012009Q1Q1200920080426WK1

    25/04/20092010M012010Q1Q1201020090425WK1

    01/05/20102011M012011Q1Q1201120100501WK1

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • Hi Livingston,

    thanks for your reply, but since it was little bit urgent, i fixed it manualy.

    anyway, 4th week's saturday of Each april from the year (calendar year) 2006 is the startdate, the excel contains dates from 2006 to 2023.

    so there will be 18 17 start and end dates.

    Thanks every one for your kind & valueable efforts.

    -Prabhu

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply