473,407 Members | 2,546 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,407 software developers and data experts.

Help INSERT INTO query

Sorry for x-post. Using Access 2000, what is wrong with this syntax?

INSERT INTO Activity (
IDType, ID, ProjectID, ComponentID, SubComponentID, ProcessDate )
VALUES (
'Employee', SELECT EmployeeID FROM tbl1104Mess , 6, 28,341, #11/02/04#
)

The desired result is to place 1 record into Activity for each 1 record in
tbl1104Mess.
With all the literal values and the EmployeeID from tbl1104Mess. I get an
error when I execute this statement. Thanks for any feedback.

Regards,
Chris
Nov 13 '05 #1
2 2077
nib
Chris Kettenbach wrote:
Sorry for x-post. Using Access 2000, what is wrong with this syntax?

INSERT INTO Activity (
IDType, ID, ProjectID, ComponentID, SubComponentID, ProcessDate )
VALUES (
'Employee', SELECT EmployeeID FROM tbl1104Mess , 6, 28,341, #11/02/04#
)

The desired result is to place 1 record into Activity for each 1 record in
tbl1104Mess.
With all the literal values and the EmployeeID from tbl1104Mess. I get an
error when I execute this statement. Thanks for any feedback.

Regards,
Chris


Uh...the problem is you can't have a query in your values list like you do.

Try:

INSERT INTO Activity (IDType, ID, ProjectID, ComponentID,
SubComponentID, ProcessDate )
SELECT 'Employee', EmployeeID, 6, 28, 341, #11/02/04#
FROM tbl1104Mess

Also, I don't know Access formatting but I'd recommend putting your date
into a more standard format. Is that November 2nd or February 11th?

Zach
Nov 13 '05 #2
Nevermind, I figured it out, I just built it this way

INSERT INTO Activity(IDType, ID, ProjectID, ComponentID, SubComponentID,
ProcessDate)
SELECT "Employee" as IDType, EmployeeID as ID, "6" as ProjectID, "28" as
ComponentID,
"341" as SubComponentID, "11/02/04" as ProcessDate FROM
tbl1104Mess

That had the desired result. Thanks for reading!!!
Chris

"Chris Kettenbach" <ch***@piasd.org> wrote in message
news:Gd********************@giganews.com...
Sorry for x-post. Using Access 2000, what is wrong with this syntax?

INSERT INTO Activity (
IDType, ID, ProjectID, ComponentID, SubComponentID, ProcessDate )
VALUES (
'Employee', SELECT EmployeeID FROM tbl1104Mess , 6, 28,341, #11/02/04#
)

The desired result is to place 1 record into Activity for each 1 record in
tbl1104Mess.
With all the literal values and the EmployeeID from tbl1104Mess. I get an
error when I execute this statement. Thanks for any feedback.

Regards,
Chris

Nov 13 '05 #3

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

Similar topics

2
by: Philip Hachey | last post by:
I think this is do-able, and possibly even simple, but it's been too many years since I've done anything significant with SQL. Any help would be appreciated. I have two tables, PAY and CHG. ...
1
by: Jimmy Tran | last post by:
Hi All, I have a table below and I want to design a query to pull all the members from the TABLE into a Query Result and into a single column with points assigned appropriately, but I am having...
2
by: Preston Landers | last post by:
Hello all. I am trying to write a query that "just" switches some data around so it is shown in a slightly different format. I am already able to do what I want in Oracle 8i, but I am having...
28
by: stu_gots | last post by:
I have been losing sleep over this puzzle, and I'm convinced my train of thought is heading in the wrong direction. It is difficult to explain my circumstances, so I will present an identical...
2
by: KoliPoki | last post by:
Greetings. I'm having a little trouble with a query. The idea is simple I need to display a list of recently unique visited URLs and the last time I visited. I have 2 table one stores the...
2
by: Chad | last post by:
I have a problem that I am desperate to understand. It involves dynamically adding controls to a Table control that is built as a result of performing a database query. I am not looking to...
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...
1
by: sujithegr8 | last post by:
HIii... Its me sujith i've done something with AJAX. but for the rest i need someo ones help.. i've done half the work. there are two tables. "ajax1" and "ajax2" (check db.sql)
4
by: Tonio Tanzi | last post by:
I have the following problem in a Win 2000 Server + SQL Server 2000 environment and I hope somewhat can help me to resolve it (after many days of useless attempts I am desperate). In my database...
2
by: Dinesh | last post by:
Hi experts, I am working on SQL Server 2005. Now i have to write a query which will extract some information from a table. My main table is having few columns supose 3 columns. EmpID ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.