criteria for month(class_date)

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

My query field is term_month:month(class_date) and the criteria I've set up
is IIf([forms]![frmSelectTutorRosterReport]![Term]="fall", Between 8 and 12,
<8) . It returns no records, but if I use 11 in place of the "Between 8 and
12" it works. What am I missing? Thanks!
 
Hi,


When we use a function, each argument, or parameter if you prefer, is
evaluated first and only then, send to the inner working of the function.


BETWEEN 8 AND 12

cannot be evaluated, just as 5 * cannot (5 times what).


Month( class_date) BETWEEN 8 AND 12

can be evaluated, so, try

IIf([forms]![frmSelectTutorRosterReport]![Term]="fall",
Month( class_date) Between 8 and 12,
Month( class_ date) <8)




Rather than using complex iif, try SWITCH:


SWITCH( FORMS!SelectTutor!Term ='winter', MONTH(class_date) <=4,
FORMS!SelectTutor!Term ='summer' , MONTH(class_date) <=8,
FORMS!SelectTutor!Term ='fall', MONTH(class_date) <=12 )


as example.



Hoping it may help,
Vanderghast, Access MVP
 
Back
Top