Conditional sum

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

Guest

I have the total hours for permanent and temporary staff and I need to add
the hours from a previously used spreadsheet. Can I do it in a query using a
conditional sum?

Permanent: 58385.5 + 22919
Temporary: 52293.7 + 21743.9

Or is there an easier way?

thanks in advance
 
Are you in the right place? This newsgroup supports Microsoft Access, a
relational database. Your post sounds like you're working in a spreadsheet.

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
Sorry I wasn't very clear (bad habit for me!)

Up until I arrived in my job, the hours for the employees were being put
into very laborious spreadsheets and I said that a database would be so much
better.

So I designed a DB and it works well. What I need to do is put the total
hours for temp and permanent staff from the spreadsheet into the database so
I know how many hours have been worked since the beginning of the year.

I want to try and put this info into a query if possible.

thanks
 
update:

In my query I have the following

Work status (group by)
hours (sum)
expr1: expr1: IIf([workstatus]="perm",58385.35,0) (average)
expr2: expr2: IIf([workstatus]="temp",52293.7,0) (Average)

what I now need to do is add up [hours], [expr1] and [expr2]
 
I guess I'm still a bit confused. Are the raw numbers (employee hours?) now
being put into a database, or are they still going into the spreasheet?

If the raw hours are input into the db, or are being imported into the db,
why do you need to add into the total hours? You can do a totals query
against your raw data (in the db) to get the total hours.

What am I missing...?

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
Back
Top