Append / Update Date ?

C

Channell

Hello,

I have a question regarding an append query and using a date. I have a
database that keeps track employees, their work areas, and what sectors they
are in within their work areas. Every day, I create new workday records for
all the employees (with great ease, thanks to this community). After I
create workdays (and their work areas are auto-assigned by default), I go
into each employee and assign their sectors (yes, there may be multiple
sectors they work in such as 311, 313, and 315). It is time consuming and
annoying to assign the sectors to the employees when 90% of the employees are
in the same sectors each day.

So, I was curious, after creating the new workday records, if there is a way
I could take the employees who worked the previous days (using an append
query) and update the old date to today's date and append the records as new
records.

I know this was horribly explained, but if you could help me, I would
greatly appreciate it. Thanks!

-Scott Channell
 
D

Dirk Goldgar

Channell said:
Hello,

I have a question regarding an append query and using a date. I have a
database that keeps track employees, their work areas, and what sectors
they
are in within their work areas. Every day, I create new workday records
for
all the employees (with great ease, thanks to this community). After I
create workdays (and their work areas are auto-assigned by default), I go
into each employee and assign their sectors (yes, there may be multiple
sectors they work in such as 311, 313, and 315). It is time consuming and
annoying to assign the sectors to the employees when 90% of the employees
are
in the same sectors each day.

So, I was curious, after creating the new workday records, if there is a
way
I could take the employees who worked the previous days (using an append
query) and update the old date to today's date and append the records as
new
records.


Sure, Scott, this should be quite easy. I don't know the name of the table
or the fields that have to be copied, but in principle a query to copy the
previous days' assignments to today would look roughly like this:

INSERT INTO WorkdayAssignments
( WorkdayDate,
EmployeeID,
Sector )
SELECT
Date() As WorkdayDate(),
EmployeeID,
Sector
FROM
WorkdayAssignments
WHERE
WorkdayDate = Date() - 1

The table and field names have to be changed, of course, and I may have left
out some fields, but I hope that gives you the idea.
 

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

Automate Records 4
Append or Update Query? 1
Global entry of records 4
Populate List Box with Parameter 1
Time input by work order 1
Error 3218 0
Multi Select List creating multiple records 13
Append Query 1

Top