avg numeric field for specific day in Access

  • Thread starter Thread starter Guest
  • Start date Start date
Your previous message was answered at 10:30. Did that solution not answer
your question?
 
dpescejr said:
average pay [PAY] field for Mondays only. Date field is named [DAY]


Avg(IIf(DatePart("d", [DAY])=1, [Pay], Null))

But you'll probably want to use that in some context. If
it's in a form/report text box, put an = sign infront of the
expression. In SQL you need to add AS AvgMonPay to name
the calculated value. In the QBE for a Totals type query,
the calculated field would just be:
IIf(DatePart("d", [DAY])=1, [Pay], Null)
with Avg in the total row.
 
Back
Top