A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Help with query calculation



 
 
Thread Tools Display Modes
  #1  
Old May 14th, 2010, 01:47 PM posted to microsoft.public.access.queries
Craig McLaughlin[_2_]
external usenet poster
 
Posts: 2
Default Help with query calculation

I need a calculation to determine holiday pay.

I have the total hrs work*5.6/52 is the calcuation I use. HOWEVER if the
person works more than 39 hrs a week those hours have to be ignored.

So if someone worked say 50hrs how would I do the same calculation but
ignoring all hours worked beyond 39?

Thanks

Craig


  #2  
Old May 14th, 2010, 02:11 PM posted to microsoft.public.access.queries
Craig McLaughlin[_2_]
external usenet poster
 
Posts: 2
Default Help with query calculation

finally solved it using the IIF function


"Craig McLaughlin" wrote in message
...
I need a calculation to determine holiday pay.

I have the total hrs work*5.6/52 is the calcuation I use. HOWEVER if the
person works more than 39 hrs a week those hours have to be ignored.

So if someone worked say 50hrs how would I do the same calculation but
ignoring all hours worked beyond 39?

Thanks

Craig



  #3  
Old May 14th, 2010, 02:32 PM posted to microsoft.public.access.queries
Krzysztof Naworyta
external usenet poster
 
Posts: 80
Default Help with query calculation

Craig McLaughlin wrote:
| I need a calculation to determine holiday pay.
|
| I have the total hrs work*5.6/52 is the calcuation I use. HOWEVER if
| the person works more than 39 hrs a week those hours have to be
| ignored.
|
| So if someone worked say 50hrs how would I do the same calculation but
| ignoring all hours worked beyond 39?

first query (qr1):

SELECT
format(date1,"mm") & Format(DatePart("ww",date1,0,0),"00") AS month_week
, Sum(hours) AS total
FROM Table1
GROUP BY
format(date1,"mm") & Format(DatePart("ww",date1,0,0),"00")

2. qr:

SELECT
sum(IIf(total39,39,total)) as tot_work_hours
FROM
qr1

--
KN
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 12:17 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.