Database Management
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesDatabase Management

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here!
  #1  
Old August 13th, 2003, 06:07 AM
Pinto Pinto is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Location: Wales UK
Posts: 3 Pinto User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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

Reply With Quote
  #2  
Old August 13th, 2003, 09:25 AM
mitakeet's Avatar
mitakeet mitakeet is offline
Last Day: May 28, 2005
Dev Shed Demi-God (4500 - 4999 posts)
 
Join Date: Jul 2003
Location: Maryland
Posts: 4,575 mitakeet User rank is Sergeant (500 - 2000 Reputation Level)mitakeet User rank is Sergeant (500 - 2000 Reputation Level)mitakeet User rank is Sergeant (500 - 2000 Reputation Level)mitakeet User rank is Sergeant (500 - 2000 Reputation Level)mitakeet User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 1 Week 2 Days 8 h 5 m 34 sec
Reputation Power: 20
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

Reply With Quote
  #3  
Old August 13th, 2003, 09:51 AM
Pinto Pinto is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Location: Wales UK
Posts: 3 Pinto User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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.

Reply With Quote
  #4  
Old August 13th, 2003, 10:00 AM
mitakeet's Avatar
mitakeet mitakeet is offline
Last Day: May 28, 2005
Dev Shed Demi-God (4500 - 4999 posts)
 
Join Date: Jul 2003
Location: Maryland
Posts: 4,575 mitakeet User rank is Sergeant (500 - 2000 Reputation Level)mitakeet User rank is Sergeant (500 - 2000 Reputation Level)mitakeet User rank is Sergeant (500 - 2000 Reputation Level)mitakeet User rank is Sergeant (500 - 2000 Reputation Level)mitakeet User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 1 Week 2 Days 8 h 5 m 34 sec
Reputation Power: 20
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'.

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesDatabase Management > How do I update one table from two


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway