query expression

  • Thread starter Thread starter Azidano
  • Start date Start date
A

Azidano

I have a Microsoft Access query with 3 fields as follows

fldName:John Doe
fldPhone: 123-456-7890
fldAddress: 123 Sample Road

I would like to create a query that will create a fourth field
(fldPhoneExt) that would display only the last 4 digits of the field
fldPhone. For example: xxx-xx-7890.

How would I modify my query to calculate this expression?
 
I have a Microsoft Access query with 3 fields as follows

fldName:John Doe
fldPhone: 123-456-7890
fldAddress: 123 Sample Road

I would like to create a query that will create a fourth field
(fldPhoneExt) that would display only the last 4 digits of the field
fldPhone. For example: xxx-xx-7890.

How would I modify my query to calculate this expression?

Add a new column to the query qrid.
fldPhoneExt:Right([fldPhone],4)
 
Expr1: Right([yourtablename].[fieldphone],4)

Type this into a new field in the query design grid.
It is the Right function which returns the rightmost characters in a string.
You can return any number of characters, but in your case you need 4.


HTH!


fredg said:
I have a Microsoft Access query with 3 fields as follows

fldName:John Doe
fldPhone: 123-456-7890
fldAddress: 123 Sample Road

I would like to create a query that will create a fourth field
(fldPhoneExt) that would display only the last 4 digits of the field
fldPhone. For example: xxx-xx-7890.

How would I modify my query to calculate this expression?

Add a new column to the query qrid.
fldPhoneExt:Right([fldPhone],4)
 
I added the new column to query grid. It did not work. Am I supposed to
select a particular type of query? Such as Append, Update query, etc?
I have a Microsoft Access query with 3 fields as follows

fldName:John Doe
fldPhone: 123-456-7890
fldAddress: 123 Sample Road

I would like to create a query that will create a fourth field
(fldPhoneExt) that would display only the last 4 digits of the field
fldPhone. For example: xxx-xx-7890.

How would I modify my query to calculate this expression?

Add a new column to the query qrid.
fldPhoneExt:Right([fldPhone],4)
 
No you shouldn't have to select a particular type of query. Check your
syntax again, also, with my example:

Expr1: Right([yourtablename].[fieldphone],4)


Are you typing the full statement including 'Expr1:' into the field line?


Azidano said:
I added the new column to query grid. It did not work. Am I supposed to
select a particular type of query? Such as Append, Update query, etc?
I have a Microsoft Access query with 3 fields as follows

fldName:John Doe
fldPhone: 123-456-7890
fldAddress: 123 Sample Road

I would like to create a query that will create a fourth field
(fldPhoneExt) that would display only the last 4 digits of the field
fldPhone. For example: xxx-xx-7890.

How would I modify my query to calculate this expression?

Add a new column to the query qrid.
fldPhoneExt:Right([fldPhone],4)
 

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

Similar Threads

Remove text from a field 2
Formatting a Field 2
Text to columns and comma delimited text 5
Merge Records 1
Format Phone Number in Listbox 1
Comparing Tables 1
Advanced Query Question 5
Listbox 1

Back
Top