The purpose for the first query is a simle way to combine last and first
names and used by many other reports.
SELECT Names.ID, [Last] & ',' & ' ' & [First] AS Names1, [First] & ' ' &
[Last] AS [Names], Names.License, Names.DOB, Names.Title, Names.Last, Names.
First, Names.[Seniority #], Names.DOH, [City] & ',' & ' ' & [State] & ' ' &
[Zip] AS AddrComb, Names.Address, Names.City, Names.State, Names.Zip, Names.
Status, Names.LicenseExpire, Names.Phone
FROM [Names];
RDO is an acronym for regular day off. Under the day of the week is the work
assignment number for that day and it may vary on some day. when an employee
is not scheduled then the field will state Off. The status fileld is for
other information that may include unscheduled time off such as sick, holiday,
personal day, vacation or a simple message to the employee "see GM"
INSERT INTO AssignmentsAll ( Seniority, Name, Status, DriverID, RDO,
StartTime, Block, EndTime, ScPayHrs, SDate )
SELECT NameComb.[Seniority #], NameComb.Names1, NameComb.Status, Assignments.
ID, Assignments.RDO, Assignments.MoStart, Assignments.Monday, Assignments.
MoEnd, Assignments.Hours, Forms!Operation!TripDate AS Expr1
FROM NameComb RIGHT JOIN Assignments ON NameComb.ID = Assignments.ID
ORDER BY Assignments.MoStart, Assignments.Monday;
Presently I run 7 queries (one each day) and I wonder if it can be done with
one or one command button based on the day of the week or date.
Thanks
Charles
Duane said:
IMHO I wouldn't spend much time with this table structure. Rather than 7 sets
of repeating fields, I would create a table that would store this information
in 7 records.
You don't have to "know how to use SQL". You can use the query designer to
build your queries and then switch to the SQL view so you can provide us with
the SQL statement.
BTW: what does RDO mean? What type of values are you storing in the Sunday
and Monday fields?
[quoted text clipped - 29 lines]