JaySquared
Registered User.
- Local time
- Today, 02:23
- Joined
- Jan 15, 2014
- Messages
- 13
I am creating a query which pulls data from my table and displays a count of the data depending on the month they fall in.
I need to pull dates from beginning of FY to end (April - March).
I have this for april:
SELECT [Project Table].[Handover or Closed Date], Count([Project Table].[Handover or Closed Date]) AS [CountOfHandover or Closed Date]
FROM [Project Table]
GROUP BY [Project Table].[Handover or Closed Date], Year([Handover or Closed Date]), DatePart("m",[Handover or Closed Date])
HAVING (((Year([Handover or Closed Date]))=Year(Now())-1) AND ((DatePart("m",[Handover or Closed Date]))=4));
Which will work fine up until April 2014, as the "Year(Now())-1)" will ensure the query returns values for April 2013!!
How do I work around this to show April 2014 after March 31st 2014??
I need to pull dates from beginning of FY to end (April - March).
I have this for april:
SELECT [Project Table].[Handover or Closed Date], Count([Project Table].[Handover or Closed Date]) AS [CountOfHandover or Closed Date]
FROM [Project Table]
GROUP BY [Project Table].[Handover or Closed Date], Year([Handover or Closed Date]), DatePart("m",[Handover or Closed Date])
HAVING (((Year([Handover or Closed Date]))=Year(Now())-1) AND ((DatePart("m",[Handover or Closed Date]))=4));
Which will work fine up until April 2014, as the "Year(Now())-1)" will ensure the query returns values for April 2013!!
How do I work around this to show April 2014 after March 31st 2014??