View Full Version : Search and display


smcal15
11-20-2009, 11:54 AM
I am new here, so if this question has already been covered...I haven't found it, so please pardon my ignorance, and redirect me. Thanks

I have a contact database in access 2007.

I am trying to search a number field for specific area codes and/or the middle three digits of the number.

...if the area code and the next three are the same, display only the last four digits of the numbers, Eg. Search for "505356" of this number 505-356-9000 and returns 9000

AND

...if the area code is the same, but the middle three are not, then display the last seven digits, Eg. Search for "505356" of this number 505-355-9000 and returns 355-9000

AND

...if the area code does not match, display the entire number. Eg. Search for "505356" of this number 506-355-9000 and returns 506-355-9000

Can someone help me, plz.

Thanks A MILLION!!! :D

ajetrumpet
11-20-2009, 12:17 PM
cal,

look up these functions...

replace(), LIKE, right(), left()


that's the order of which you'll use them if you look em up and apply em to what you r askinn here.