A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Updating Fields with one charachter to another



 
 
Thread Tools Display Modes
  #1  
Old February 12th, 2007, 10:23 PM posted to microsoft.public.access.queries
Craig
external usenet poster
 
Posts: 14
Default Updating Fields with one charachter to another

I have 75 fields in a database that are all marked with either 'A', 'B' or
'C' or blank. I want to change all populated fields to a 'Y' so that I can
see they they are associated to a group, but i dont want to be able to see
what group they belong to. Each person in the database can belong to one or
more of the 75 fields.

How can I change these records without using Find/Replace.

Craig


  #2  
Old February 12th, 2007, 11:14 PM posted to microsoft.public.access.queries
John W. Vinson
external usenet poster
 
Posts: 18,261
Default Updating Fields with one charachter to another

On Mon, 12 Feb 2007 17:23:13 -0500, "Craig"
wrote:

I have 75 fields in a database that are all marked with either 'A', 'B' or
'C' or blank.


Ow.

You don't have a database. You have a spreadsheet! If each field's
name is the name of a group, your database is incorrectly normalized.
A much better design would have three tables:

Persons
PersonID Primary Key
LastName
FirstName
other biographical data

Groups
GroupID Primary Key
GroupName
other info about the group as a whole, if needed

Membership
PersonID
GroupID
any info about this person's membership in this group, such as a
text field containing A, B, or C, if you want to keep that info

I want to change all populated fields to a 'Y' so that I can
see they they are associated to a group, but i dont want to be able to see
what group they belong to. Each person in the database can belong to one or
more of the 75 fields.

How can I change these records without using Find/Replace.


If you want to *permanently and irrevocably* lose the distinction
between A, B and C, you can run an Update query updating *all 75*
fields to:

IIF(IsNull([fieldname]), Null, "Y")

using the seventy-five different fieldnames.

I'd REALLY suggest stepping back and restructuring your database
though; not only are queries going to be a real nightmare, but if you
ever need to add or change a group, you'll need to restructure your
table, all your queries, all your forms, and all your reports that use
this table.

If I'm misunderstanding your use of the terms "field" and "group"
please post back... on rereading, I may well be, but if so I clearly
don't understand your table structure.

John W. Vinson [MVP]
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 11:40 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.