Quick Sum(IIf) help needed!

mosh

Registered User.
Local time
Today, 20:19
Joined
Aug 22, 2005
Messages
133
Hey all,

I have the following data on a subform:

EmployeeName, Payroll NUmber, Initial Request date, date_booked, leave_type, part_of_day, hours_booked, Notes,

1)I want to count the amount of instances where leave_type = "Sickness" in the last 6 momnths/

Calculate the amount of hours(hours_booked)/24 to convert in days in the last 12 months.

I have tried the following:

1) =Sum(IIf([leave_type]="Sickness",1)) < not sure how to do the date bit

2) Same first part as above but still not sure on how to calculate the date part.

Thanks very much

Mohsin
________
Glass Pipes
 
Last edited:
Use DCount(). Look it up in Access help.
 
still finding it difficult to create it.

For the first requirement I have the below, but does not work.

=DCOUNT(IIF([Leave_Type]="Sickness" AND [date_booked]<Format(Date(), "yyyy" -1),1,0))
________
Park Royal Condos Pattaya
 
Last edited:
You don't need the Iif(). Have another look at Access Help. It takes three parameters, the Field you are counting, the table or query that holds the field and the conditions to be met.
 

Users who are viewing this thread

Back
Top Bottom