Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Must do an UPDATE QUERY 1

Status
Not open for further replies.

KadiDancer

Programmer
Jun 12, 2001
5
US
Hello...

I need help with an update query. I have posted this question a couple of times, you think by now I would remember what forum I have it under.

ANyway, basically , I just added a list of new names into our database, and I want them to have the same information as all the others (Salutation, mailings, cultivation, etc.) How do I do this. All this info. is standard, on every record (name) in either an "Individual" or "Institutional" form.

So, how can I run this query and update just those names so they have some of the same information as all the rest?


I hope to hear from you soon
 
Basically, you have to have some means of distinguishing the newly added records from those that pre-existed them. If you have an autonumber key field, for example, you could include that field as part of your update query (but not as an updated field) to select out and update only those records that have a KeyID > [insert number here]. Alternatively, you could update only records that have null values in the salutation field, mailing field, etc. Just include some criteria in the update query on the appropriate field so that it doesn't update every record, only the new ones that need updating.

From what you've said, it's hard to tell exactly what you're doing. You say:

I want them to have the same information as all the others (Salutation, mailings, cultivation, etc.) How do I do this. All this info. is standard, on every record (name) in either an "Individual" or "Institutional" form.

If you really do have information that is "standard for every record", then it should be broken out into a different table, not repeated for every record. You should try to avoid redundancy.

If the information does in fact vary from record to record, for example if men have different salutations from women, then you will need to have a field to handle this in the main table. But the best way to handle this is probably to just go through manually in a datasheet and enter Mr. and Mrs. in each spot (or better, have a field where you check M or F). There has to be some way to distinguish which people are men and which are women. People can look at names and easily distinguish this, but to build that name-recognizing logic into a computer would be time-consuming and prone to error. (And if you did have a routine that could determine from existing information whether a person was male or female, you wouldn't need to save that information in a field! You could always just appeal to the subroutine).

Hope this helps a little. If not, I'm sure I or others on the board could provide more help if we had a little more information about what's in these saluation fields, mailing list fields, etc., and also if we knew what the other fields in your tables are. -- Herb

 
Herb... thank you SO much for responding so promptly to my question. I was having trouble articulating what needs to be done, so I hope this offers a little more information.

Here is what I am doing specifically:

I need to update 2000 new names into our database. In each database record (each different name), there are a number of boxes that I check: mailings (there are 3 types of different mailings), cultivation (retired, cultivation, etc.) event attendee (different venues to check for our performances).

SO, it would be rather tedious to check of these boxes one by one (2000 times). So, do I need to run an update query for this (I am assuming yes) ?

Maybe this willbe a little more clear as to what needs to be done. I am a little confused.

Many thanks....
 
It appears as if the needed info varies from person to person. If there is a way to group/select a subset of them needing the same exact field settings, update will work by selecting just those groups and repeating with multiple updates. Otherwise, it's one by one.


Dave
 
To expand on Dave's response, you can use update only if there's some information already in one or more of the fields of the new records that you can use to identify a subset that need to be updated in the same way.

For example, you have three different types of mailings. How do you decide what sort of mailing a person will receive? If the information necessary to decide that is already in the existing fields somewhere, then you can use already existing field(s) to identify which records will be updated.

As one possibility: Suppose that you send a particular mailing only to people over 60. If you already have the person's birthdate in a date field, you could create an update query that would update the "Mailing" field of only those people who are over 60.

You can do similar things in other situations so long as there is something in the already-existing data that can serve as a basis for identifying what records need to be updated.

But an UPDATE query isn't magical. It can't magically determine which records need what different sorts of updates. That has to be determined by you. If you can use already-existing data to identify subsets of the records in a database that all need the same update, then you can use an UPDATE query to speed up the process. Otherwise, the record-by-record hand editing is going to be your only solution. -- Herb

 
Thanks guys...

All your input will help me a HUGE deal, once I actually start the Update Query.

As you may have figured out, I am pretty new at this, so I greatly appreciate everything!

Many thanks...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top