Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to get the FY if not part of the current year
Message
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Miscellaneous
Thread ID:
00678540
Message ID:
00678639
Views:
12
This message has been marked as a message which has helped to the initial question of the thread.
What about having a fiscalCalendar table which can be used to store fiscal events like years and quarters?

-Mike

>I have a customer who's fiscal year begin on June 1st anybody have some idea's on how to modify the query below to handle that?
>
>Thanks in advance
>
>
>set @tiYear = 2002
>set @tiFiscalMonth = 6
>
>SELECT co1.specdesc,AdmitDesc,
>	(select COUNT(dbo.meetings.meetingnumber)
>	   from dbo.meetings
>	   where datepart(yy,begintime)= @tiYear
>	   and meetings.specID = co1.specID
>           and meetings.AdmitTypeID = m1.AdmitTypeID
>	   and iscancelled = 0) as YTD
>FROM   dbo.ctAdmissionType ad INNER JOIN
>       dbo.meetings m1 ON ad.AdmitTypeID = m1.AdmitTypeID INNER JOIN
>       dbo.cospec co1 ON m1.specid = co1.specid
>where  m1.iscancelled=0
>group by ad.AdmitDesc,m1.admitTypeID,co1.specdesc,co1.specID
>order by 1
>
>
Michael Levy
MCSD, MCDBA
ma_levy@hotmail.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform