Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Queries / March 2008

Tip: Looking for answers? Try searching our database.

if statement

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
RhondaR - 09 Mar 2008 22:28 GMT
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
Marshall Barton - 10 Mar 2008 00:46 GMT
>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
[quoted text clipped - 4 lines]
>
>How do I write the update statement? All I have so far is Like "*(*"

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

Signature

Marsh
MVP [MS Access]

fredg - 10 Mar 2008 00:47 GMT
> 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
[quoted text clipped - 7 lines]
> 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";

Signature

Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.