B
Bethany via AccessMonster.com
I am trying to create a parameter query where the user will enter a begin
date and an end date. When I run the query with the dates hard coded
(between #05/01/2005# and #05/31/2005#), I get the correct results. When I
run the query as a parameter query, I get result records in the correct
month, day range, but I'm getting records from prior year even though the
year is used as part of the date. The field used as criteria
(qry_monthly_comm_detail.Pol_effdt) is a CDATE so from everything I
understand date is the only consideration when referring to the criteria
entered for the query. Can someone look at this and tell me what I am doing
wrong? Thank you so much for your help.
SELECT qry_monthly_comm_detail.Premium, qry_monthly_comm_detail.[Pol Num],
qry_monthly_comm_detail.Nrcode, qry_monthly_comm_detail.Pol_effdt
FROM compare_gl_commission_missing_fromGL INNER JOIN
qry_monthly_comm_detail ON
compare_gl_commission_missing_fromGL.Policy_number =
qry_monthly_comm_detail.[Pol Num]
WHERE ((qry_monthly_comm_detail.Pol_effdt) Between #5/1/2005# And
#5/31/2005#)
SELECT qry_monthly_comm_detail.Premium, qry_monthly_comm_detail.[Pol Num],
qry_monthly_comm_detail.Nrcode, qry_monthly_comm_detail.Pol_effdt
FROM compare_gl_commission_missing_fromGL INNER JOIN
qry_monthly_comm_detail ON
compare_gl_commission_missing_fromGL.Policy_number =
qry_monthly_comm_detail.[Pol Num]
WHERE ((qry_monthly_comm_detail.Pol_effdt) Between [type month begin date]
And [type month end date])
date and an end date. When I run the query with the dates hard coded
(between #05/01/2005# and #05/31/2005#), I get the correct results. When I
run the query as a parameter query, I get result records in the correct
month, day range, but I'm getting records from prior year even though the
year is used as part of the date. The field used as criteria
(qry_monthly_comm_detail.Pol_effdt) is a CDATE so from everything I
understand date is the only consideration when referring to the criteria
entered for the query. Can someone look at this and tell me what I am doing
wrong? Thank you so much for your help.
SELECT qry_monthly_comm_detail.Premium, qry_monthly_comm_detail.[Pol Num],
qry_monthly_comm_detail.Nrcode, qry_monthly_comm_detail.Pol_effdt
FROM compare_gl_commission_missing_fromGL INNER JOIN
qry_monthly_comm_detail ON
compare_gl_commission_missing_fromGL.Policy_number =
qry_monthly_comm_detail.[Pol Num]
WHERE ((qry_monthly_comm_detail.Pol_effdt) Between #5/1/2005# And
#5/31/2005#)
SELECT qry_monthly_comm_detail.Premium, qry_monthly_comm_detail.[Pol Num],
qry_monthly_comm_detail.Nrcode, qry_monthly_comm_detail.Pol_effdt
FROM compare_gl_commission_missing_fromGL INNER JOIN
qry_monthly_comm_detail ON
compare_gl_commission_missing_fromGL.Policy_number =
qry_monthly_comm_detail.[Pol Num]
WHERE ((qry_monthly_comm_detail.Pol_effdt) Between [type month begin date]
And [type month end date])