Run a series of queries

G

Guest

hello all,

can someone help me run append query where the date criteria comes from a
dlookup?

qryTimeSheets
fldName
fldHours
fldDate

Dlookup is getting the dates from tblPayDates - this table is populated in
the beginning of the year through a userform.

The reason for this scheme is because I need to sum the hours for a
payperiod for all payperiods from the beginning of the year to present - to
track a cumulative amount of hours worked above 80 hours for a two week
period.
 
R

Rob Oldfield

You'll need to provide some more detail about what's going wrong. By
default, if you run a query that references another query, then anything
(including lookups) that the second one needs will be evaluated
automaticlly. What are you trying and what error are you getting?
 
G

Guest

Thanks for taking this one on Rob,
I haven't got so far to get an error.
I'm having trouble setting this thing up.
Here is some more detail:
I created a database with a linked table from our payroll system
tblTimeSheets and created another table with the paydates throughout the
current year:
tblPaydates
fldCountID PayBeg PayEnd
1 1/1/06 1/15/06
2 1/16/06 1/30/06
...and so on

tblTimeSheets will track the submitted hours from the employee's but what
the system does not do is track the overtime in the way that we would like to
award it, which is:
1. Hours over 80 for a two week period are considered OT
2. Before we pay out the overtime, the person must work 35 hours of OT first
which is not paid out, then any and all above that initial 35 hours of OT is
paid.
So the object of what I'm trying to set up is the user would choose what
payperiod they want to calc from the tblPayDates, then I wanted to run an
append query for each payperiod from the tblTimeSheets into
tblGatherPayperiods
My initial plan was to set up a macro that runs 24 appendqueries or loop the
same one where the date criteria was fldPayEnd from the tblPayDates so I
could have the payperiods separated to calc and cum the OT.
I don't know how to reference the date criteria from tblPayDates when I'm
setting up a query with tblTimeSheets as the datasource.
I could just manually enter all the dates in and udate it every year but
that's ridiculous.
 

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

Similar Threads

Date Range and totals 7
Most Recent Date 5
Xbox Series X anomaly (sort of) 4
run a series of queries 1
Queries? 9
End of Month: Parameter Query? 3
Combining Multiple Records in Queries 1
Combining Date queries 1

Top