Date Comparison when you only have the month and the year

Tech-Archive recommends: Speed Up your PC by fixing your registry



Hi Everyone,

Thanks for the help.

I have a table with monthly data. Two of the fields are:

Month n(2,0)
Year n(4,0)

There is also an amount field
Amount n(11,2)

I have been asked to query this table based on From and Thru dates and I
don't seem to be able to get the syntax correct

The following expressions in the WHERE clause seem to be causing the problem

DATE(Year, Month, 1) >= TheFromDate AND DATE(Year, Month, 1) <= TheThruDate

What would be the correct way to code this in SQL given that my table has
Month and Year and my criteria for From and Thru are dates?

Thanks,
Jeff


.