473,672 Members | 2,762 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 6850
On Thu, 17 Mar 2005 21:38:58 -0500, "What-a-Tool"
<Di************ *************@I HateSpam.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.c om...
On Thu, 17 Mar 2005 21:38:58 -0500, "What-a-Tool"
<Di************ *************@I HateSpam.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.rena etl> 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************ *************@I HateSpam.Com> wrote in message
news:7br_d.6701 4$SF.42077@lake read08...
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************ *************@I HateSpam.Com> wrote in message
news:VPy_d.6702 5$SF.10217@lake read08...
"What-a-Tool" <Di************ *************@I HateSpam.Com> wrote in message
news:7br_d.6701 4$SF.42077@lake read08...
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************ *************@I HateSpam.Com> wrote in message
news:7br_d.6701 4$SF.42077@lake read08...
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
7611
by: Yves Glodt | last post by:
Hello, if I do this: for row in sqlsth: ________pkcolumns.append(row.strip()) ________etc without a prior:
2
5779
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 database and then i create a basic append query that appends the new records to the table(tblonlinereg). this works great if the field is greater than the last record appended ( where: tempID > 198 ) but how would i update/append the modifications...
2
1846
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 subsets structure and this way only the existing fields in the destination will be filled? That would be great, but it seems that the append query wants you to specify the fields. is there another way around this? I want to do it in code and it...
6
8153
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" in another table but I have not found what the field criteria should look like? 2: And if/when I succeed I should further like to build a new record (with
4
7384
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 imported text file. I can update the data through an update query or append the entire import table through an append query. Is there a way to combine the two so that I can update existing records and append only new records (without duplicating...
0
1699
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 am trying to modify the Microsoft Template at the following address (http://office.microsoft.com/en-us/templates/TC012186931033.aspx?CategoryID=CT101426031033) to work as an issues tracker that imports and updates the issues from a SQL 2005...
13
2030
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 certain table. I know this part of my question has been answered and I understand how to do it quite well after searching long and hard for an answer to my next part. I can either import the text file directly into the table or into it's own seperate...
10
2048
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 ill give you a little background. I have done programming in the past in Basic, VB, and a little C. I am not much of a programmer, its more of a hobby/curiosity. The following code is not mine, i am trying to modify a template of a mock database....
4
7600
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 an excel spreadsheet. There are two tables. One is a list of general contacts, and the other is a list of clubs. The clubs contain members who are within the contacts table. When I add a list of new club members from the
0
8406
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8932
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8831
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8609
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8683
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5707
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4230
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4419
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2821
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.