If I have a start date of 1/1/2013 and an end date of 5/17/2013, is there a query way to return Jan, Feb,March, Apri and May? I am looking for the query to return the months during the start and end period.
SELECT MonthName(Month(yourDateField)), Sum(yourMoneyField) AS Total
FROM yourTable
WHERE yourDateField Between yourStartDate And yourEndDate
GROUP BY Month(yourDateField)
There may or may not be a record for each month. what i have are hundreds of names with various beg/end dates, and I want to write to another table each person and a record for each month of their beg/end period. For examplel, if Mike is in from jan - march, i want to load to a table the following;
name month year
Mike jan 2012
Mike Feb 2012
Mike Mar 2012
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.