
Originally Posted by
rpeare
Your first query isn't checking the date at all so how is it giving you the results you want if you want to apply date criteria to your query? Nor is the query ordered the same way.
Are you sure your fields on your form as in a date format? Are you generating this SQL statement dynamically or do you actually have a saved query? Are you sure the 'date' field in your table tblMainTWTTPSheet is being stored as a date and not as a text value?
I suspect there is a disconnect between how the date value is being stored and the date criteria (by the way it's poor practice to use reserved words for field names like 'date', 'year', 'month', 'control', etc).
you may be able to try criteria like
between "#" & forms!frmstratificationofrootcauses!startdate 7 "#" and "#" & forms!frmstratificationofrootcauses!enddate & "#"
This would force your start date and end date to be considered dates if they are currently being considered strings