Query expression calling for a previous month

rbrule

Registered User.
Local time
Today, 07:25
Joined
Jan 13, 2004
Messages
108
Hello again,
I am now creating a calculated field in a query which draws data from a month previous to the current month. For example, IIf ([mfg]=a and [date of sale]= any date last month, 250,0)

How would I express " any date last month" so that the results would allways be automatic.

rbrule
 
Replace the "any day last month" with
Code:
(Month(Date()))-1
and [date of sale] with
Code:
Month([date of sale])
 
Hello,

Your expression brings me to last month (January), but doesn't distinguish between last month this year, or January in any previous years.

Is there a way to refine it? Basically I need the expression to refer to the month immediately previous to now.

Thanks
rbrule
 
I am sorry to be such a knot head, but I tried both of the last two scenarios and I get an error message that says

"The expression you entered has a function containing the wrong number of arguments."

What might I be doing wrong?
 
Thank you very much for your help. I finally got it to work. I must have been typing something wrong.
 

Users who are viewing this thread

Back
Top Bottom