if statement

  • Thread starter Thread starter RhondaR
  • Start date Start date
R

RhondaR

Hi. I have a text field (each one with a different number of characters)
where some of the records at the end of their sentence contain "(CA)", or
"(CA", or neither one.

I need to find all the "(CA" records and change them to "(CA)", while
leaving all the other records alone.

How do I write the update statement? All I have so far is Like "*(*"

Thanks!
Rhonda
 
Hi. I have a text field (each one with a different number of characters)
where some of the records at the end of their sentence contain "(CA)", or
"(CA", or neither one.

I need to find all the "(CA" records and change them to "(CA)", while
leaving all the other records alone.

How do I write the update statement? All I have so far is Like "*(*"

Thanks!
Rhonda

A permanent change?
Create an Update query.
Back up your table first.

Update YourTable Set YourTable.[FieldName] =
Left([FieldName],Len([FieldName])-3) & "(CA)"
Where Right([FieldName],3) = "(CA";
 
RhondaR said:
Hi. I have a text field (each one with a different number of characters)
where some of the records at the end of their sentence contain "(CA)", or
"(CA", or neither one.

I need to find all the "(CA" records and change them to "(CA)", while
leaving all the other records alone.

How do I write the update statement? All I have so far is Like "*(*"


UPDATE thetable SET thefield = thefield & ")"
WHERE thefield Like "*(CA"
 
Back
Top