Hello,
I have two tables,
Clients: [Client ID] [Location].....
Followup: [Client ID] [Location] [Date] [Results]
I would like to mass update by inserting new records in followup based on [Location] in Clients. That is, if Location is = "Mumbai" insert a new record into Followup, containing each Client ID and Location in addition to a [Date] and [Results], the date and results will be the same for each. So my end result in Followup will be like the following
[ Client ID] [Location][Date][Results]
(01), (Mumbai), (2008-03-04), (Positive)
(07), (Mumbai), (2008-03-04), (Positive)
(11), (Mumbai), (2008-03-04), (Positive)
(15), (Mumbai), (2008-03-04), (Positive)
(22), (Mumbai), (2008-03-04), (Positive)
(22), (Mumbai), (2008-03-04), (Positive)
(24), (Mumbai), (2008-03-04), (Positive)
(27), (Mumbai), (2008-03-04), (Positive)
(31), (Mumbai), (2008-03-04), (Positive)
(38), (Mumbai), (2008-03-04), (Positive)
(50), (Mumbai), (2008-03-04), (Positive)
Any ideas?
Thanks
JAS
3 1242
Hello,
I have two tables,
Clients: [Client ID] [Location].....
Followup: [Client ID] [Location] [Date] [Results]
I would like to mass update by inserting new records in followup based on [Location] in Clients. That is, if Location is = "Mumbai" insert a new record into Followup, containing each Client ID and Location in addition to a [Date] and [Results], the date and results will be the same for each. So my end result in Followup will be like the following
[ Client ID] [Location][Date][Results]
(01), (Mumbai), (2008-03-04), (Positive)
(07), (Mumbai), (2008-03-04), (Positive)
(11), (Mumbai), (2008-03-04), (Positive)
(15), (Mumbai), (2008-03-04), (Positive)
(22), (Mumbai), (2008-03-04), (Positive)
(22), (Mumbai), (2008-03-04), (Positive)
(24), (Mumbai), (2008-03-04), (Positive)
(27), (Mumbai), (2008-03-04), (Positive)
(31), (Mumbai), (2008-03-04), (Positive)
(38), (Mumbai), (2008-03-04), (Positive)
(50), (Mumbai), (2008-03-04), (Positive)
Any ideas?
Thanks
JAS
Are you looking at something like: -
-
INSERT INTO followup SELECT clientid,location,'2008-03-04','Positive' FROM client WHERE location = 'Mumbai'
-
-
wow, so simple, but not very intuitive....worked like a charm.
I looked but all I could find was how to select and insert the selected column data only.
Thanks
wow, so simple, but not very intuitive....worked like a charm.
I looked but all I could find was how to select and insert the selected column data only.
Thanks
You are Welcome Jas2803. Do post back in case of any further issues!!
Sign in to post your reply or Sign up for a free account.
Similar topics
by: jason |
last post by:
How does one loop through the contents of a form complicated by dynamic
construction of checkboxes which are assigned a 'model' and 'listingID' to
the NAME field on the fly in this syntax:...
|
by: Joe |
last post by:
Hey,
I'm going to give some background on my situation in case anyone can
point out a way around my problem altogether... for the problem
itself, please skip to the bottom of the post. thanks....
|
by: Primo |
last post by:
Hello,
I am building a data management application with the following processes:
Process 1 is a Windows service which uses FileSystemWatcher to monitor a
directory.
Process 2 opens a file...
|
by: jaYPee |
last post by:
I have search a lot of thread in google newsgroup and read a lot of
articles but still i don't know how to update the dataset that has 3
tables.
my 3 tables looks like the 3 tables from...
|
by: Humble Geek |
last post by:
Hi all. Quick and perhaps silly question, but...
I am using Pg 7.3. I am writing a function using pgplsql. This function will
perform multiple inserts. Let's say two of the inserts are as...
|
by: Diego |
last post by:
Hi everybody!
I'm using DB2 PE v8.2.3 for linux. I've defined a database with the
following schema:
ANNOTATION(ID,AUTHOR,TEXT)
ANNOTATION_BOOK(ANNOTATION_ID,OBJECT_ID)...
|
by: dustwel |
last post by:
I am currently trying to write a trigger that when an insert or update is made to a table, it inserts a copy of the row into a log table. It currently works when one row is inserted, but it will...
|
by: BostonNole |
last post by:
I am using SQL 2000 and VB.NET (VS 2005).
I have three stored procedure: sp_A, sp_B and sp_C
I need to be able to call sp_A once and sp_B and sp_C 1 to n number of
times all within a single...
|
by: gchq |
last post by:
Hi there
This was the closest to Sybase I could see....
If I wanted to perform a multiple insert based on values in a table using, say a web app, I'd define a DataTable and bring in the...
|
by: bonneylake |
last post by:
Hey Everyone,
Well recently i been inserting multiple fields for a section in my form called "serial". Well now i am trying to insert multiple fields for the not only the serial section but also...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
|
by: PapaRatzi |
last post by:
Hello,
I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: Defcon1945 |
last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
|
by: Shællîpôpï 09 |
last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
|
by: af34tf |
last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
| |