Alex
Consider stepping back... If you make this just a select query, does find
what you want?
When that part's working, move back to working out the INSERT portion.
What happens when it "doesn't work"?
--
Regards
Jeff Boyce
Microsoft Office/Access MVP
Microsoft IT Academy Program Mentor
http://microsoftitacademy.com/
Hi Jeff
Thanks. I am trying the quick and dirty way first and this is the code I
have and it is not working:
INSERT INTO ArchiveHolidayNotTaken
SELECT HolidayNotTaken.*
FROM ((Employees INNER JOIN HolidayNotTaken ON Employees.EmployeeID =
HolidayNotTaken.EmployeeID) INNER JOIN Holidays ON HolidayNotTaken.HolDate
=
Holidays.Date) INNER JOIN [Temporary] ON HolidayNotTaken.EmployeeID =
Temporary.EmployeeID
WHERE (((Holidays.Date)<=([employees].[archivecalcdate])));
A quick explanation :
Holidays Table: contains the real dates
HolNotTaken Table: contains the lookup
HolNotTaken is a joined table with Employees
Temporary is a temp Table (I know that's obvious) containing the records
to
work with
Thanks for your help in advance
:
Alex
From your description, you have a table that holds a "lookup" type
field. A
scan through the tablesdbdesign newsgroup, and a look at mvps.org/access
will show a strong consensus against using lookup fields in tables. One
reason why is just what you've described.
The problem you're running into is that what is stored, and what
appears,
are not the same. If you want to look up/query a date of, say,
3/31/2006,
you might have to (know, remember, discover) that you have to use DateID
=
237 or some such.
The quick/dirty solution is to join the date lookup table (where the
dates
are coming from) and do your query criteria of actual dates against the
actual date field in that lookup dates table.
A more permanent solution is to change the field-type in the main table
to
whatever matches your lookup date table's ID data type. Then, what you
see
is what you get. But you still would want to join to the lookup date
table
to be able to search by actual date.
--
Regards
Jeff Boyce
Microsoft Office/Access MVP
Microsoft IT Academy Program Mentor
http://microsoftitacademy.com/
Hi all
I am running a query that uses the WHERE Clase on a lookup field. The
lookup
field contains lookup dates. I have noticed that they are not stored
as
dates. Coud anyone help in figuring this one out please?
Thanks