SoonerNation
Programmer
This query works sometimes, I could sure use some help.
Requirement: User provides starting month/year and ending month/year. I need to query for dates in that range.
The Query seems to work fine until ending month is less than starting month. The data set is huge, so I don't know exactly what the results should be. But, anytime ending month is less that starting month, zero records are returned??? i.e. Start= 12/2005 End=01/2006 returns zero records and should be 4,000-5,000.
The query I'm using:
Select rDate,BYR,SSN
From Form100
Where (Month(rDate)>=#Val(Form.StartMonth)# and Year(rDate)>=#StartYear#)
and (Month(rDate)<=#Val(Form.EndMonth)# and Year(rDate)<=#EndYear#)
Thanks
Lyndon
Requirement: User provides starting month/year and ending month/year. I need to query for dates in that range.
The Query seems to work fine until ending month is less than starting month. The data set is huge, so I don't know exactly what the results should be. But, anytime ending month is less that starting month, zero records are returned??? i.e. Start= 12/2005 End=01/2006 returns zero records and should be 4,000-5,000.
The query I'm using:
Select rDate,BYR,SSN
From Form100
Where (Month(rDate)>=#Val(Form.StartMonth)# and Year(rDate)>=#StartYear#)
and (Month(rDate)<=#Val(Form.EndMonth)# and Year(rDate)<=#EndYear#)
Thanks
Lyndon