My DB has a separate column for month and year (see below).
I am looking for the proper way to pull data between 2 dates.
My DB Table is set up as follows:
I want to create a query where I can input something similar to:
SELECT STATE, ISNULL(SUM(MILES),0), ISNULL(SUM(GALLONS),0)
AND date between 01-2015 and 07-2015
Group by STATE"
I am not concerned about the physical date within the month. So really I need the SQL to look for dates between 01-2015 and 07-2015
My problem is I'm not sure how I concatenate the month/year into one for both the START and END between dates or even if it is possible with the way the table structure is set up.
Not even sure how to write a declare statement (I know how but not sure it would work).
I'm hoping I explained myself properly.