View Full Version : Between""And""


knzass
11-01-2001, 05:10 PM
i have a form with two combo boxes "MonthStart" and "MonthEnd" each displaying the months of the year from january to december(ive assigned 1-jan,2-feb, etc)
i made a query which selects between these two values, the field name is "(DatePart("m",[Tb_Case_Log]![Date_Today])) "
and the criteria is " Between [Forms]![Fr_Statistic]![Month1] And [Forms]![Fr_Statistic]![Month2] "
(the query also has fields for group by and count)

i have a record which stores the number of cases...
august - 8 cases
september - 6 cases
october - case

i played with the combo boxes and these are the results

DateStart DateEnd
"august" "August" = 8 (ok)
"September" "September" = 6 (ok)
"october" "octber" = 1 (ok)
"august" "september" = 14 (ok)
"august" "october" = 9 (not ok)
"september" "october" = 15 (not ok)

what is wrong with the query?

knzass
11-01-2001, 05:18 PM
opss the criteria is " Between [Forms]![Fr_Statistic]![MonthStart] And [Forms]![Fr_Statistic]![MonthEnd] "
(not MOnth1 and Month2)

Pat Hartman
11-01-2001, 06:20 PM
Don't you think you need to consider the year as well? What's going to happen when you get to Jan 2002?