|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here! |
|
#1
|
|||
|
|||
|
How do I update one table from two
I'm afraid I'm a newbie to SQL. I can write simple select, insert and update comands but I'm stuck on this one.
I have an employees table (tblITAbs_Employees) and a table (tblITAbs_AbsenceWeeks) with a weekly record for each employee. I want to have a text box where a date is entered, click a button and then for every employee in tblITAbs_Employees insert a record for that week into tblITAbs_AbsenceWeeks. I could do this in Access queries but am stumped in SQL. It is an update I want to run fro my asp web page. TIA ![]() |
|
#2
|
||||
|
||||
|
Try something like this:
Code:
insert tblITAbs_AbsenceWeeks (employeeid, date) select employee, '1/1/1900' from tblITAbs_Employees
__________________
Left DevShed May 28, 2005. Reason: Unresponsive administrators. Free code: http://sol-biotech.com/code/. Secure Programming: http://sol-biotech.com/code/SecProgFAQ.html. Performance Programming: http://sol-biotech.com/code/PerformanceProgramming.html. It is not that old programmers are any smarter or code better, it is just that they have made the same stupid mistake so many times that it is second nature to fix it. --Me, I just made it up The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man. --George Bernard Shaw |
|
#3
|
|||
|
|||
|
Brilliant
That works fine, thank you so much.
What is the syntax to include the textbox instead of '1/1/1900' ? Do you know a site that has free tutorials/tips where I can learn things like this ? I know a bit of SQL from my VBA coding days as I didn't always use the query builder. |
|
#4
|
||||
|
||||
|
If you mean a text box from a CGI/ASP page, your application that processes the GET/POST will have to do that part.
There should be plenty of tutorials, just google on 'Access' and 'tutorial' with 'CGI' or 'ASP'. |
![]() |
| Viewing: Dev Shed Forums > Databases > Database Management > How do I update one table from two |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|