Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 947165
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T23:02:32+00:00 2026-05-15T23:02:32+00:00

I have another SQL/access 2007 question that seems really basic but I’m not sure

  • 0

I have another SQL/access 2007 question that seems really basic but I’m not sure how to Google for it.

I have this table STUDENT-TERMS with the following fields:

StudentTermID

StudentID (links to STUDENT table)

TermID (links to TERMS table)

TermGPA (this is the nugget of info that needs to be recorded)

STUDENT table looks like this:

StudentID

Name

TERMS table looks like this:

TermID

Start date

End date

I have a document with all of the info that gets uploaded into the Access doc. This document that I get has the same student and term IDs as exist in the database.

Then I can run an append query to get the data into the STUDENT-TERMS table. Which is fine.

How do I write the query such that there is only one record of each term for each student?
So for example I have this data in the table right now:

StudentTerm ID: 5

StudentID: Tara

TermID: 1011Autumn

TermGPA: 3.8

When I upload and append a new document, it might still contain that information about Tara and I want the db to say “Hey, we already have that, skip it” as it does the appending. How do I indicate that?

HERE IS THE CONCLUSION/ANSWER/RESOLUTION:
Thanks for your help everyone. This is what I wound up doing:

  1. I made a new field in the table called StudentTerm which contains a concatenation of the StudentID and the Term (like so: Tara1011Autumn). This field is indexed with no duplicates.

  2. The query that performs the appending looks like this:

INSERT INTO StudentTerms ( StudentID, TermID, GPA, StudentTerm )
SELECT
Upload_Students.StudentID, Upload_Students.TermID, Upload_Students.GPA,
[Upload_Students]![StudentID] & [Upload_Students]![TermID] AS Expr1
FROM Students INNER JOIN Upload_Students ON Students.StudentID = Upload_Students.StudentID;

This query attempts to fill the StudentTerm field with Tara1011Autumn. If that string already exists in the table, it won’t append the record.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T23:02:34+00:00Added an answer on May 15, 2026 at 11:02 pm

    Create a unique index on the [student-terms] table, with the StudentID and StudentTermID fields in the index.

    Then, when you run the append query Access will tell you “# records couldn’t be added due to key violations”, before asking you if you want to continue. If you hit Yes in that dialog box, then all the non-violating records will be appended, and the offending records will be saved into a different table.

    There are other options available in the DoCmd.RunQuery action if you’re doing this from VBA to automate this.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 490k
  • Answers 490k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer First of all, it's a really bad idea to use… May 16, 2026 at 9:17 am
  • Editorial Team
    Editorial Team added an answer If you are not dead set on using a listbox,… May 16, 2026 at 9:17 am
  • Editorial Team
    Editorial Team added an answer killproc will terminate programs in the process list which match… May 16, 2026 at 9:17 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I've got an Access 2007 database that I developed which connects to SQL Server
I am using Access 2007 and have some linked tables to a mySQL database.
I'm re-casting a question I asked earlier now that I have an idea of
I have very little experience using Sharepoint but a good amount using Visual Studio
SharePoint 2007 (WSS or MOSS) logs are not easy to read even on a
Is it possible, in Microsoft Access 2007, to allow a user to select and
---AFTER FURTHER INVESTIGATION--- tblABC in the below example must be a linked table (to
I'm creating a WPF application using the MVVM design pattern, and I'm trying to
I want to create a Windows 7 64-bit (Ultimate) virtual machine with: Visual Studio

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.