using update queries

W

wheelz

I am still struggling with update queries. I am trying to do a mass update
for 12 dates during the year. Each person gets those days off but receives
different hours off for that day. Can anyone help me with this? It would be
greatly appreciated.

Matt
 
J

John Vinson

I am still struggling with update queries. I am trying to do a mass update
for 12 dates during the year. Each person gets those days off but receives
different hours off for that day. Can anyone help me with this? It would be
greatly appreciated.

Matt

Note that an Update query updates *records which already exist in your
table*. Just what do you want updated? Do you perhaps want to run an
Append query appending twelve records for each employee? What is the
structure of the table you're trying to update?

John W. Vinson[MVP]
Join the online Access Chats
Tuesday 11am EDT - Thursday 3:30pm EDT
http://community.compuserve.com/msdevapps
 
W

wheelz

I have the names of the employees and I need to have a different record for
each employee for the 12 days off. I want to try and like the date of the
holiday to the date of the day. If the two dates match then everyone gets
that day off. If they don't match then it keeps going to check the other
days in the week, until it finds a match or moves on.

Matt
 
J

John Vinson

I have the names of the employees and I need to have a different record for
each employee for the 12 days off. I want to try and like the date of the
holiday to the date of the day. If the two dates match then everyone gets
that day off. If they don't match then it keeps going to check the other
days in the week, until it finds a match or moves on.

That's not how queries work. You're thinking procedurally - queries
work in "sets" instead, in an all-at-once manner. You run the query
and it updates (or adds, or deletes, or displays - depending on the
type of query) all the records which match, in one go.

I would GUESS that what you want is a Table named tblHolidays, with
one datefield (and perhaps a text field naming the holiday).

You could create a Query including this table and your employee table,
with NO join line; if tblHolidays has 12 records, you'll see twelve
records for each employee. You can then run this as an Append query to
a days-off table (which I presume you have, though you haven't posted
any information about the structure of your tables).

John W. Vinson[MVP]
Join the online Access Chats
Tuesday 11am EDT - Thursday 3:30pm EDT
http://community.compuserve.com/msdevapps
 
W

wheelz

It is actually multiple tables. One table is the employee name and the start
date & end end of the pay period, and the date for the days of the week. On
another table I have the 12 holidays and their dates. I am trying to get it
so that when the day's date matches the holiday's date all employee receive
holiday pay for that day. There are different holiday hours available to the
employee depending on the work schedule: (8,7,5,4.4, and 3.2 hrs)
 
J

John Vinson

It is actually multiple tables. One table is the employee name and the start
date & end end of the pay period, and the date for the days of the week. On
another table I have the 12 holidays and their dates. I am trying to get it
so that when the day's date matches the holiday's date all employee receive
holiday pay for that day. There are different holiday hours available to the
employee depending on the work schedule: (8,7,5,4.4, and 3.2 hrs)

I'm not understanding clearly. Could you post the names of the tables
and the names and datatypes of the relevant fields? Where is the "work
schedule" stored? What do you mean by "the date for the days of the
week" - if you have a Date/Time field, that's derived data which I
would think needs no table!

John W. Vinson[MVP]
Join the online Access Chats
Tuesday 11am EDT - Thursday 3:30pm EDT
http://community.compuserve.com/msdevapps
 
Top