Update Query outputing numbers only

  • Thread starter Thread starter EyeSpec
  • Start date Start date
E

EyeSpec

I am trying to update an Area Code field in a table
to "000" when the field doesn't contain a three digit
number. The table field has to remain a text field for
other relationships and queries. Any suggestions on what
to put in the criteria field to give the desired results.

Thx, Doug
 
Something like the following should set the Area Code to three zeroes if it
currently contains something besides three digits. So "12" would get update to
"000", as would "" and Null field.

UPDATE YourTable
Set [AreaCode] = "000"
WHERE [AreaCode] Is Null
Or [AreaCode] Not Like "###"
 
Something like the following should set the Area Code to three zeroes if it
currently contains something besides three digits. So "12" would get update to
"000", as would "" and Null field.

UPDATE YourTable
Set [AreaCode] = "000"
WHERE [AreaCode] Is Null
Or [AreaCode] Not Like "###"
 
Thank You. That did it. It acually worked without having
to include the null statement.
Thanks again
-----Original Message-----
Something like the following should set the Area Code to three zeroes if it
currently contains something besides three digits. So "12" would get update to
"000", as would "" and Null field.

UPDATE YourTable
Set [AreaCode] = "000"
WHERE [AreaCode] Is Null
Or [AreaCode] Not Like "###"
I am trying to update an Area Code field in a table
to "000" when the field doesn't contain a three digit
number. The table field has to remain a text field for
other relationships and queries. Any suggestions on what
to put in the criteria field to give the desired results.

Thx, Doug
.
 
Back
Top