I have a table which has a date field named 'icu_admit'. I am trying to retrieve the number of records between specific date periods, for example one specific date range can be 01-Feb-2011 to 31-Aug-2011.
I inserted the start and end date in the following statement: Total_Recs = DCount("[icu_admit]", "LOS_table", "[icu_admit] >= #01-Feb-2011# And [icu_admit] = #31-Aug_2011#") which returned the correct number of records.
Since I have numerous start and end dates, I tried to replace the actual dates with the variables 'start_date' and 'end_date' in the statement, then define the start and end with different dates. That did not work and instead I received the error message "The expression you entered as a query parameter produced this error 'The object doesn't contain the Automation object 'start_date'.
How can I build a statement to accomplish this? Your help will be greatly appreciated. -Thanks!
Keep Up with TechRepublic