index | search | no replies | posting guidelines | help login | register
Index » Programming Languages » SQL
search this forum:
:: Getting Records for a Fiscal Year ::    show all messagesPost a New Message | Post a Reply
Oct 10 2003, 1:37 PM
 Re: Getting Records for a Fiscal YearPost a Reply
 whichman

View this author's profile Send this author a private message Visit author's homepage

from: Laurel, MD

To select  multiple Fiscal years try this:

SELECT *, 'FiscalYear' =
  CASE
    WHEN ([Reporting Month] < 10) THEN [Reporting Year]-1
    ELSE [Reporting Year]
  END
INTO #T1
FROM Visitation

SELECT * FROM #T1
  WHERE FiscalYear IN (1999,2000,2001,2002)
  ORDER BY FiscalYear

DROP TABLE #T1



-------------------------
Master of the Game
Pages: (1)   [1]

search this forum: