Single Table Update Query

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,

I have a single table with the following fields:
NPA, NXX, Line (all with data) and BTN (Blank)

I want to populate the field BTN with NPANXXLINE. I don't care what the data
is in NPA, NXX, or Line as I simply want them to be combined as a string in
BTN.

I'm sure the answer is simple, but as with most things in Access, I try to
make it WAY too hard...
 
Sounds like you need a simple update query like:
UPDATE [TableName] SET BTN = [NPA] & [NXX] & [Line];
 
Hi David

Please tell me - this is really simple. I have a field with some records
blank, and others with valid info.
What formula do I enter in my update query Criteria item to update the blank
fields with a value, say, "Unassigned". I have tried "" and nil and blank
with no success.

Thank you
Will
 
Will_Harris_ZA said:
Hi David

Please tell me - this is really simple. I have a field with some
records blank, and others with valid info.
What formula do I enter in my update query Criteria item to update
the blank fields with a value, say, "Unassigned". I have tried "" and
nil and blank with no success.

Is Null

UPDATE TableName
SET FieldName = "Unassigned"
WHERE FieldName Is Null
OR FieldName = ""

The last line is only necessary if the field allows zero length strings.
 
Excellent, thank you Rick.

Same thing, a little more complex. For another field, which needs primary
key status. Accordingly every record has to be unique.

The input mask is as follows: LLLLLLLLL\-999\_999990/999;0;-

I would like to run the same update record, this time allocating a unique
number to every record, preferably in sequence. Is this possible?

For example:
UNASSIGNE-000_000000/001
UNASSIGNE-000_000000/002
etc

Can you do it? Really appreciate your help

Will
 
Back
Top