Go Back   Access World Forums > Microsoft Access Discussion > Queries

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 11-20-2016, 09:12 PM   #1
RossD
Newly Registered User
 
Join Date: Nov 2016
Posts: 6
Thanks: 5
Thanked 0 Times in 0 Posts
RossD is on a distinguished road
Question Append Query appending thousands of rows

Hi,

I'm new to Access (i.e. have limited knowledge and experience).

I have an append query in place which has worked previously, but seems to 'have lost its way'.

The table I'm appending from has 71 records.

When I run the query, the message reads: " You are about to append 21868 row(s)".

I'm not sure why it's not just appending just the 71 records as before.

Any ideas?

RossD is offline   Reply With Quote
Old 11-20-2016, 09:48 PM   #2
The_Doc_Man
Happy Retired Curmudgeon
 
Join Date: Feb 2001
Location: Suburban New Orleans, LA, USA
Posts: 12,578
Thanks: 62
Thanked 1,203 Times in 1,103 Posts
The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold
Re: Append Query appending thousands of rows

Post the query. From your description, we have insufficient information.

Wouldn't hurt to know at least a little of the table structure including whether you have any oddities like mapping an Excel file as though it were an external table. Thinks like that.
__________________
I'm a certified grandpa (3 times now) and proud of it.
Retired over one year and survived being home all day with the wife. She must really love me.
If I have helped you, please either click the thanks or click the scales.
The_Doc_Man is offline   Reply With Quote
The Following User Says Thank You to The_Doc_Man For This Useful Post:
RossD (11-21-2016)
Old 11-20-2016, 09:49 PM   #3
JHB
Have been here a while
 
Join Date: Jun 2012
Location: In the south of Denmark (Jutland), near the German border.
Posts: 7,471
Thanks: 2
Thanked 2,002 Times in 1,958 Posts
JHB has a spectacular aura about JHB has a spectacular aura about
Re: Append Query appending thousands of rows

Show the SQL-string for the query.
One reason could be if you've included another table/query in the append query.

__________________
If the above post has helped you, why not take the time to say thank you, by pressing the "Thumbs up."
JHB is offline   Reply With Quote
The Following User Says Thank You to JHB For This Useful Post:
RossD (11-21-2016)
Old 11-21-2016, 03:05 AM   #4
RossD
Newly Registered User
 
Join Date: Nov 2016
Posts: 6
Thanks: 5
Thanked 0 Times in 0 Posts
RossD is on a distinguished road
Re: Append Query appending thousands of rows

INSERT INTO [Session Record] ( Reference, PPSStatus, AddSession, AccountNumber, Customer, EmailAddress1, Emailaddress2, StudentNumber, StudentName, StudentCal, TutorNumber, TutorName, Email, TutorCal, [Day], StartTime, FinishTime, Location, ClosedRemarks, OpenRemarks, UnitAmount, TutorRate, SCFlink )
SELECT WeeklyTimetable.Reference, WeeklyTimetable.PPSStatus, WeeklyTimetable.AddSession, WeeklyTimetable.AccountNumber, WeeklyTimetable.Customer, WeeklyTimetable.EmailAddress1, WeeklyTimetable.Emailaddress2, WeeklyTimetable.StudentNumber, WeeklyTimetable.StudentName, WeeklyTimetable.StudentCal, WeeklyTimetable.TutorNumber, WeeklyTimetable.TutorName, WeeklyTimetable.Email, WeeklyTimetable.TutorCal, WeeklyTimetable.Day, WeeklyTimetable.StartTime, WeeklyTimetable.FinishTime, WeeklyTimetable.Location, WeeklyTimetable.ClosedRemarks, WeeklyTimetable.OpenRemarks, WeeklyTimetable.UnitAmount, WeeklyTimetable.TutorRate, WeeklyTimetable.SCFlink
FROM WeeklyTimetable, [Session Record];
RossD is offline   Reply With Quote
Old 11-21-2016, 03:10 AM   #5
RossD
Newly Registered User
 
Join Date: Nov 2016
Posts: 6
Thanks: 5
Thanked 0 Times in 0 Posts
RossD is on a distinguished road
Re: Append Query appending thousands of rows

Hi The_Doc_Man,

I don't think I'm mapping an excel file.

Table 1 (where I'm appending from) has 23 fields

Table 2 (Where I'm appending to) has 42 fields (23 of which it has in common with table 1)

Both tables have a relationship with Tables A, B and C where they have one field in common.
RossD is offline   Reply With Quote
Old 11-21-2016, 03:26 AM   #6
JHB
Have been here a while
 
Join Date: Jun 2012
Location: In the south of Denmark (Jutland), near the German border.
Posts: 7,471
Thanks: 2
Thanked 2,002 Times in 1,958 Posts
JHB has a spectacular aura about JHB has a spectacular aura about
Re: Append Query appending thousands of rows

Take away the second table [Session Record], (it is located in the "FROM WeeklyTimetable, [Session Record];").
__________________
If the above post has helped you, why not take the time to say thank you, by pressing the "Thumbs up."
JHB is offline   Reply With Quote
The Following User Says Thank You to JHB For This Useful Post:
RossD (11-21-2016)
Old 11-21-2016, 02:42 PM   #7
RossD
Newly Registered User
 
Join Date: Nov 2016
Posts: 6
Thanks: 5
Thanked 0 Times in 0 Posts
RossD is on a distinguished road
Re: Append Query appending thousands of rows

JHB,

Thank you VERY much - that has worked a treat.

I've check previous versions of my DB and the "[Session Record]" was not in the SQL-string; not sure how or why it appeared :/

Thanks again.


RossD is offline   Reply With Quote
Reply

Tags
append , excess rows , query

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Append query not appending flhr0175 Queries 13 05-05-2016 09:16 AM
Append Query not appending entire table sp2231 Queries 8 03-02-2015 02:22 PM
Append query not appending dark11984 Queries 3 09-12-2008 02:35 PM
Append query...Appending EXPONENTIALLY ??!?? Ethereal Queries 2 01-24-2006 06:27 AM
Append query - appending multiple tables quickly gotidude Queries 1 08-12-2005 03:51 PM




All times are GMT -8. The time now is 06:54 PM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Featured Forum post


Sponsored Links


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World