Seasons Greetings All!-
I need to pull the number of days in any given month from a date range. The start of the date range is a field called [hookupdate] and the end of the date range is a field called [enddate]. I need to be able to tell how many days in that range fall within any given month, but don't want to base it on the current date. The users may need to go back and pull historical data for reports and so I want them to be able to enter the [Begin Date] and [End Date] as parameters for whatever month they are looking for. I tried this query but it doesn't like it.
SELECT tblEM.HookupDate, tblEM.EndDate, IIf([hookupdate]<[Begin Date] And [enddate]>[End Date],[End Date]-[Begin Date],"Test") AS DaysServed
FROM tblEM;
It works up until I ask it to subtract the two parameter values from eachother. Any way to assign those to variables or something like that?
Thanks for your time!
I need to pull the number of days in any given month from a date range. The start of the date range is a field called [hookupdate] and the end of the date range is a field called [enddate]. I need to be able to tell how many days in that range fall within any given month, but don't want to base it on the current date. The users may need to go back and pull historical data for reports and so I want them to be able to enter the [Begin Date] and [End Date] as parameters for whatever month they are looking for. I tried this query but it doesn't like it.
SELECT tblEM.HookupDate, tblEM.EndDate, IIf([hookupdate]<[Begin Date] And [enddate]>[End Date],[End Date]-[Begin Date],"Test") AS DaysServed
FROM tblEM;
It works up until I ask it to subtract the two parameter values from eachother. Any way to assign those to variables or something like that?
Thanks for your time!