473,320 Members | 1,580 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Help with an update query

CK
Hi All,

We have a budgeting table and a budgetAssistant table, I have 3 employee ID's,
I need to assign each of them as budget assistant. Do you know of a quick
update query I could write to accomplish this? The budget and
budgetAssistant tables both have a budgetID field. Any ideas?

I wanted to select those employees, then select all the budget then loop
through and add those 3 to each budget as a budgetAssistant.

Thanks,

~CK
Oct 24 '06 #1
3 1207
Perhaps if you included a bit more information, a psuedo example of
information in the tables would help a little.
CK wrote:
Hi All,

We have a budgeting table and a budgetAssistant table, I have 3 employee ID's,
I need to assign each of them as budget assistant. Do you know of a quick
update query I could write to accomplish this? The budget and
budgetAssistant tables both have a budgetID field. Any ideas?

I wanted to select those employees, then select all the budget then loop
through and add those 3 to each budget as a budgetAssistant.

Thanks,

~CK
Oct 24 '06 #2
This might give you some ideas.

INSERT budgetAssistant (budgetID, employee)
SELECT B.budgetID, Add3.employee
FROM budgeting as B CROSS JOIN
(select 123 as employee UNION ALL
select 345 UNION ALL
select 567) AS Add3

Roy Harvey
Beacon Falls, CT

On Tue, 24 Oct 2006 19:53:31 GMT, "CK" <c_**********@hotmail.com>
wrote:
>Hi All,

We have a budgeting table and a budgetAssistant table, I have 3 employee ID's,
I need to assign each of them as budget assistant. Do you know of a quick
update query I could write to accomplish this? The budget and
budgetAssistant tables both have a budgetID field. Any ideas?

I wanted to select those employees, then select all the budget then loop
through and add those 3 to each budget as a budgetAssistant.

Thanks,

~CK
Oct 24 '06 #3
CK
Thanks Roy!

I used this and it worked as well

INSERT INTO BudgetAssistant (BudgetID, EmployeeID)

SELECT * FROM (
SELECT BudgetID, EmployeeID FROM Budget, (
SELECT EmployeeID FROM TeamMember WHERE TeamID=96) A)tmp
"Roy Harvey" <ro********@snet.netwrote in message
news:mb********************************@4ax.com...
This might give you some ideas.

INSERT budgetAssistant (budgetID, employee)
SELECT B.budgetID, Add3.employee
FROM budgeting as B CROSS JOIN
(select 123 as employee UNION ALL
select 345 UNION ALL
select 567) AS Add3

Roy Harvey
Beacon Falls, CT

On Tue, 24 Oct 2006 19:53:31 GMT, "CK" <c_**********@hotmail.com>
wrote:
>>Hi All,

We have a budgeting table and a budgetAssistant table, I have 3 employee
ID's,
I need to assign each of them as budget assistant. Do you know of a quick
update query I could write to accomplish this? The budget and
budgetAssistant tables both have a budgetID field. Any ideas?

I wanted to select those employees, then select all the budget then loop
through and add those 3 to each budget as a budgetAssistant.

Thanks,

~CK

Oct 25 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Somerset Bob | last post by:
I've posted my query at the phpbb forum, where I got half an answer and then no more. I posted it again at another phpbb forum, where I got half an answer and no more. I posted it in alt.php, where...
0
by: Somerset Bob | last post by:
I've posted my query at the phpbb forum, where I got half an answer and then no more. I posted it again at another phpbb forum, where I got half an answer and no more. I posted it in alt.php, where...
4
by: Surendra | last post by:
I have this query that I need to use in an Update statement to populate a field in the table by the value of Sq ---------------------------------------------------------------------------- Inline...
6
by: John Baker | last post by:
Hi: As those who have looked at this newsgroup recently will realize, I am a neophyte with Access, although I have experienced with Approach (the Lotus product). There are things I could easily...
9
by: hope | last post by:
Hi Access 97 I'm lost on this code please can you help ================================= Below is some simple code that will concatenate a single field's value from multiple records into a...
10
by: Randy Harris | last post by:
I imported records into a table, later found out that many of them had trailing spaces in one of the fields. If I'd caught it sooner, I could have trimmed the spaces before the import. This...
4
by: Laura | last post by:
Here's the situation: I'm trying to use an update query to copy data from one row to another. Here is the situation: I have 5 companies that are linked to each other. I need to show all 5...
3
by: Shapper | last post by:
Hello, I have created 3 functions to insert, update and delete an Access database record. The Insert and the Delete code are working fine. The update is not. I checked and my database has all...
6
by: Takeadoe | last post by:
Dear NG, Can someone assist me with writing the little code that is needed to run an update table query each time the database is opened? From what I've been able to glean from this group, the...
16
by: ARC | last post by:
Hello all, So I'm knee deep in this import utility program, and am coming up with all sorts of "gotcha's!". 1st off. On a "Find Duplicates Query", does anyone have a good solution for...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
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...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
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...
1
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)...
1
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...
0
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
0
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...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.