Checking if a date falls between two dates?

wim1981

Registered User.
Local time
Tomorrow, 00:22
Joined
May 20, 2015
Messages
40
Hi everyone,

i want to check if a date falls between the first date of a year and the last date of a year.

The goal is to go through a table in the database that contains dates in a column. There are for example several dates in the year 2014 and there are dates in the year 2015.

What i want to do is get a list in a report that shows me for every year a line in the list with other data that i will calculate. So a line for 2014 and a line for 2015.

How can i do that?

Regards
Wim
 
You can use a TOTALS or a GROUP BY Query. Something like.
Code:
SELECT
    Year(yourDateField) As YearNumber,
    Count(anotherFieldName) As TotalSales
FROM 
    yourTable
GROUP BY
    Year(yourDateFieldName)
 
You can use a TOTALS or a GROUP BY Query. Something like.
Code:
SELECT
    Year(yourDateField) As YearNumber,
    Count(anotherFieldName) As TotalSales
FROM 
    yourTable
GROUP BY
    Year(yourDateFieldName)

Hi pr2,

I will try it this afternoon.

Thanks ;)

Wim
 

Users who are viewing this thread

Back
Top Bottom