• raghuldrag - Sunday, December 17, 2017 10:47 PM

    Hi Friends,

    i have a table  like  below i want to display financial year count

    Create table test
    (M1 vacrhar(20),
      M2 char(100)
    )

    insert  into test  values ('2001-2002','APR')
    insert  into test  values ('2001-2002','JUN')
    insert  into test  values ('2002-2003','NOV')
    insert  into test  values ('2003-2004','APR')
    insert  into test  values ('2001-2002','JUN')
    insert  into test  values ('2003-2004','DEC')

    if  we  gave the input from  m1 ='2001-2002'  and m2="APR'
     to m1='2003-2004' and m2='APR'

    i have to display no of financial year count
    (Apr-1999 to mar-2000) as one financial year

    kindly give me your suggestion

    Considering that neither your table nor your query makes any mention of either the year 1999 or 2000, please explain the logic you're using to convert the inputs to the desired output.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)