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, 12:23 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

Try this:

DECLARE @FiscalYear INT
SELECT @FiscalYear = 2002
SELECT * FROM Visitation
  WHERE ([Reporting Year] = @FiscalYear AND [Reporting Month] > 9)
    OR ([Reporting Month] < 10 AND [Reporting Year] = (@FiscalYear + 1))
  ORDER BY [Reporting Year],[Reporting Month]


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

search this forum: