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

Append if not already existing query question?

Remember seeing a post a while back from someone who wanted to add to a
table only if the data didn't already exist.
Someone suggested a type of query called an "Up" something or other. Can't
remember - could someone refresh my memory on this please?

Thanks

Nov 13 '05 #1
7 6833
On Thu, 17 Mar 2005 21:38:58 -0500, "What-a-Tool"
<Di*************************@IHateSpam.Com> wrote:

In SQL you have to do that in two steps:
1: determine if the record exists, using a Select query.
2: run either an Update query or an Append query.

-Tom.

Remember seeing a post a while back from someone who wanted to add to a
table only if the data didn't already exist.
Someone suggested a type of query called an "Up" something or other. Can't
remember - could someone refresh my memory on this please?

Thanks


Nov 13 '05 #2
If the new record contains data that would duplicate existing data in a
field that is indexed as "no duplicates", an append query will discard the
duplicate records and not append them. Thus, depending upon the data, it's
possible that this process can be done just with an append query.

--

Ken Snell
<MS ACCESS MVP>

"Tom van Stiphout" <no*************@cox.net> wrote in message
news:44********************************@4ax.com...
On Thu, 17 Mar 2005 21:38:58 -0500, "What-a-Tool"
<Di*************************@IHateSpam.Com> wrote:

In SQL you have to do that in two steps:
1: determine if the record exists, using a Select query.
2: run either an Update query or an Append query.

-Tom.

Remember seeing a post a while back from someone who wanted to add to a
table only if the data didn't already exist.
Someone suggested a type of query called an "Up" something or other. Can't
remember - could someone refresh my memory on this please?

Thanks

Nov 13 '05 #3
On Thu, 17 Mar 2005 22:19:01 -0500, "Ken Snell"
<kt***********@ncoomcastt.renaetl> wrote:

You may be right. One would hope (and I was expecting) that a proper
db design was already in place. I took the OP's comments a bit more
liberally. Surely if he wanted to add an EXACT duplicate record, or
even exact duplicate values for the unique index column(s), we would
all scratch our heads...
Upon re-read it's indeed not clear he would want to update if the
record already exists.
-Tom.
If the new record contains data that would duplicate existing data in a
field that is indexed as "no duplicates", an append query will discard the
duplicate records and not append them. Thus, depending upon the data, it's
possible that this process can be done just with an append query.


Nov 13 '05 #4
if you don't have the unique index Tom and Ken are talking about in
your table already, you can use the Find Unmatched query wizard to find
the records in the one table that aren't in the other. then turn that
into an append query.

Nov 13 '05 #5
"What-a-Tool" <Di*************************@IHateSpam.Com> wrote in message
news:7br_d.67014$SF.42077@lakeread08...
Remember seeing a post a while back from someone who wanted to add to a
table only if the data didn't already exist.
Someone suggested a type of query called an "Up" something or other. Can't
remember - could someone refresh my memory on this please?

Thanks



I have a PK identifier, and a row of fields containing changeable data. If
the PK is the same, I want to update whichever of the other fields has been
out-dated by the new data. Believe I could simply do this with an Update
Query.

But, this got me remembering the other post mentioned - I thought I saved
it, but can no longer find it. All I am trying to remember is the name of
this type of query - I feel as if it's right on the tip of my tongue, and
its bugging me. If I have the name, I can look it up in the Microsoft SDK
myself.

I seem to remember that it was a type of query that was only supported in
Access, and it was call an UP?/Something query. Can anyone help with this
name?

Thank You
Nov 13 '05 #6
If you want to change data that are already in a record, you use an update
query.

Update queries are supported by SQL in general -- they're not unique to
ACCESS.

--

Ken Snell
<MS ACCESS MVP>
"What-a-Tool" <Di*************************@IHateSpam.Com> wrote in message
news:VPy_d.67025$SF.10217@lakeread08...
"What-a-Tool" <Di*************************@IHateSpam.Com> wrote in message
news:7br_d.67014$SF.42077@lakeread08...
Remember seeing a post a while back from someone who wanted to add to a
table only if the data didn't already exist.
Someone suggested a type of query called an "Up" something or other.
Can't remember - could someone refresh my memory on this please?

Thanks



I have a PK identifier, and a row of fields containing changeable data. If
the PK is the same, I want to update whichever of the other fields has
been out-dated by the new data. Believe I could simply do this with an
Update Query.

But, this got me remembering the other post mentioned - I thought I saved
it, but can no longer find it. All I am trying to remember is the name of
this type of query - I feel as if it's right on the tip of my tongue, and
its bugging me. If I have the name, I can look it up in the Microsoft SDK
myself.

I seem to remember that it was a type of query that was only supported in
Access, and it was call an UP?/Something query. Can anyone help with this
name?

Thank You

Nov 13 '05 #7
Finally found the old post I was talking about.
It was an UPSERT query I was trying to remember the name of.

Not what I need, but at least now I have stopped that damn itching in my
brain.

Thanks for your help

"What-a-Tool" <Di*************************@IHateSpam.Com> wrote in message
news:7br_d.67014$SF.42077@lakeread08...
Remember seeing a post a while back from someone who wanted to add to a
table only if the data didn't already exist.
Someone suggested a type of query called an "Up" something or other. Can't
remember - could someone refresh my memory on this please?

Thanks


Nov 13 '05 #8

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

Similar topics

25
by: Yves Glodt | last post by:
Hello, if I do this: for row in sqlsth: ________pkcolumns.append(row.strip()) ________etc without a prior:
2
by: JMCN | last post by:
hi i have a general question regarding append queries in access 97. each week i need to update my table(tblonlinereg) with new or modified records. firstly, i import the text file into my...
2
by: Danny | last post by:
I want to extract a subset of fields from one table into another the master table has many fields the subset has about half, but still many. Is there a way I can just append the master into the...
6
by: Sven Pran | last post by:
Probably the answer is there just in front of me only awaiting me to discover it, but: 1: I want to build a query that returns all records in one table for which there is no successful "join"...
4
by: MN | last post by:
I have to import a tab-delimited text file daily into Access through a macro. All of the data needs to be added to an existing table. Some of the data already exists but may be updated by the...
0
by: jon | last post by:
Hi there, I'm brand new to Access and may be trying to do too much too soon, but I wanted to get some expert advice on how the best way to go about what I am trying to accomplish would be. I...
13
by: mpslanker | last post by:
This is my first time posting here, so if I have made any mistakes (i.e. wrong forum area, etc) I am sorry. I have an Access database that I have to import a text file into and append it to a...
10
by: pythonnoob | last post by:
Hello everyone. New to python as well as this forum, but i must say ive learned a but already reading through some posts. Seems to be a pretty helpful community here. Before i post a question...
4
by: franc sutherland | last post by:
Hello, I am using Access 2003. I am having trouble trapping the "can't append all the records in the append query" error message when appending data to a query from a table which is linked to...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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.