Results 1 to 3 of 3
  1. #1
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,878
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Help With Append Query (a2k (9.0.6926) SP-3 Jet 4.0 SP-8)

    I have a table with the following records

    <pre>Specialty ID Specialty
    1 Optometrist
    2 Children's Dentist
    3 General Dentistry
    4 New Dentist
    5 Orthodontics
    </pre>


    Iím trying to add one record to the table with this append query

    <pre>INSERT INTO tblSpecialties ( strSpecialty )
    SELECT "NA" AS Expr1
    FROM tblSpecialties;
    </pre>


    And I am getting the following 5 records

    <pre>Specialty ID Specialty
    6 NA
    7 NA
    8 NA
    9 NA
    10 NA
    </pre>


    Specialty ID is a autonumber

    What do i have the change to just get the one record
    6 NA

    Thanks, John

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Help With Append Query (a2k (9.0.6926) SP-3 Jet 4.0 SP-8)

    Because of the SELECT ... FROM ..., you'll add as many records as there already were [img]/forums/images/smilies/sad.gif[/img]
    INSERT INTO has another form where you add a single record:

    INSERT INTO tblSpecialties ( strSpecialty )
    VALUES ( "NA" )

  3. #3
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,878
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Help With Append Query (a2k (9.0.6926) SP-3 Jet 4.0 SP-8)

    Woops!

    Thank you for that

    John

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •