Formula Works but not as Criteria

  • Thread starter Thread starter fred
  • Start date Start date
F

fred

(CDbl((Format(Now(),"mm"))-2) Mod 12)+1


All I want is last month. IF this month is january, (1) I want
December, (12).

This formula should take care of of all that. If I put it as an
Expression in a field, It works fine. I get the number corrospondnig to
last month.

If I put it in into the criteria section, I don't get squat. If I put
what it resolves to in teh criteria section, it works fine. What
gives? Any Ideas?

Fred
 
Well, it is actually NOT a date time field. I am basicly looking for data over the past three years,
for last month. When April comes around I want March data for the last three years. the field I am
working with just consists of the month as a number, and the formula I had gave me last month as a
number. It just would not work in a criteria field. It looks like I got it working by using the
formula provided in a boolean equation, than just looking for "trues" in the criteria section. Seems
to be working.

Thanx to all
 
Back
Top