Update query using Left function

G

Guest

I am trying to update some area codes and want to use the Left function.
What I want is simply to be able to identify the area code so that it may be
deleted, used in a make table query, etc. According to Special Edition Using
Access 2000, by Roger Jennings, page 335, the following should work:

Left ("phone",3)=999

However, when I try to use this in an Update query in the criteria row, the
following message is returned to me. The Expression you entered has a
function containing the wrong number of arguments.

Also, I have found that when I actually update a phone number with an area
code change and I use the following, I don't have any problems.

In the Update row: 777&right([phone],8)

the area code is updated to 777 just fine. 8 has to be used because most of
the phone numbers are formated with a dash between the exchange and last four
digits. Notice the ampersand after 777.

What I am also trying to do is isolate area codes in this way:

Left ("phone",3)=999,222,555. These are several area codes in one
metropolitan area.

What is the correct code to use so that I won't receive these syntax errors?

Then I can do a make table query of the isolated area codes or a delete
query or if necessary, an update query.
 
T

tina

use the same syntax that you used for the Right() function, as

Left ([phone],3)=

where the use of the brackets makes phone a reference to a field in the
query's table, not

Left ("phone",3)=

where the use of the double quotes makes phone simply a string, that doesn't
refer to anything.

hth
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top