Posts
 
Reputation
Joined
Last Seen
0 Reputation Points
Unknown Quality Score

No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.

0 Endorsements
~5K People Reached
Favorite Forums
Favorite Tags
Member Avatar for hitro456

Hi everyone, I have database which has data of past 2 years. I want to get that data for current financial year. [COLOR="Green"](Here financial year is 1st april to 31st of March)[/COLOR] This query returns data for current calender year i.e. [Jan-to-Dec] [COde=sql] SELECT DATENAME(MONTH, DATE) AS MonthName, SUM(NetAMOUNT) AS …

Member Avatar for Raj_28
0
4K
Member Avatar for Conficker111111

Below dynamic query will set StartDate and EndDate to 1st of March to 30th April as UK financial year. DECLARE @StartDate DATETIME DECLARE @EndDate DATETIME SET @StartDate = DATEADD(dd,0, DATEDIFF(dd,0, DATEADD( mm, -(((12 + DATEPART(m, getDate())) - 4)%12), getDate() ) - datePart(d,DATEADD( mm, -(((12 + DATEPART(m, getDate())) - 4)%12),getDate() ))+1 …

Member Avatar for Conficker111111
0
1K