Append aSelect Query (1 Viewer)

DavRob

New member
Local time
Today, 10:03
Joined
Oct 19, 2019
Messages
27
Hi All

I am trying to append the results of a Select Query, I have read about and tried many variations, but can not get it do want I want

I have a Query that is based on 2 Tables "TblCustomers" and " TblCustomersData" both Tables have identical Fields

When I run the Query I would like to Append the results into Table "TblCompletedJobsAddressed" (same fields as the Query Tables) I know this should be simple but I just can not get it to work

Dave
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 17:33
Joined
Oct 29, 2018
Messages
21,454
Hi Dave. Can you show us what you tried? Was it something like this?
Code:
INSERT INTO TblCompletedJobsAddressed SELECT * FROM QueryName
 

DavRob

New member
Local time
Today, 10:03
Joined
Oct 19, 2019
Messages
27
Hi TheDBGuy

INSERT INTO TblCompletedJobsAddressed (JobNo, Address, Date)
SELECT JobNo, Address, Date
FROM QryCompletedJobs
WHERE JobNo = NotNull

Dave
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 17:33
Joined
Oct 29, 2018
Messages
21,454
... WHERE JobNo Is Not Null
 

DavRob

New member
Local time
Today, 10:03
Joined
Oct 19, 2019
Messages
27
Hi TheDBGuy

Thanks for your reply, You are correct I Forgot the "Is"

The code
Code:
INSERT INTO TblCompletedJobsAddressed SELECT * FROM QueryName

Is an Append Query, What I would like to do is to have a Query tor code that do both functions ie. run a Select Query then Append the results, is this possible or do I need to run 2 separate Queries.

Dave
 

isladogs

MVP / VIP
Local time
Today, 01:33
Joined
Jan 14, 2017
Messages
18,209
Yes it should be simple to do as a single query but you haven't said what happens when you try it.
Do you get an error? If so what?

However, why do you want to append this data?
Doing so would lead to data duplication which goes against standard database principles
 

DavRob

New member
Local time
Today, 10:03
Joined
Oct 19, 2019
Messages
27
Hi isladogs

Thanks for your reply

No error, I was getting no results from the query

I have just realized that I have been over thinking this problem, so I am going back a few steps and taking a different approach

Dave
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 17:33
Joined
Oct 29, 2018
Messages
21,454
Hi Dave. Good luck and let us know how it goes.
 

Users who are viewing this thread

Top Bottom