avg numeric field for specific day in Access

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

Guest

average pay [PAY] field for Mondays only. Date field is named [DAY]
 
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top