By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,705 Members | 1,815 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,705 IT Pros & Developers. It's quick & easy.

Adding another number digit into my fax database.

P: 9
Hi all, I am happy with my fax database until my goverment decided to add another 6 infront of all the phone and fax number.

How can I change all the numbers together?

Example from : 1234567 to 61234567

Thanks.
Sep 4 '07 #1
Share this Question
Share on Google+
13 Replies


100+
P: 222
You can use a loop to navigate through all records

and add 6 as string into the phone number field


dim x as string

phone_number="6"+phone_number
Sep 4 '07 #2

Rabbit
Expert Mod 10K+
P: 12,389
You can just do it with an update query.
Sep 4 '07 #3

P: 9
Thanks guys, for a simple user like me, the 6 & [FaxFieldName] works well.

One more question, I found out that there some fax numbers that are not key in correctly, some less 1 digit, some extra 1 digit.

How can I remove all these?
Sep 6 '07 #4

Rabbit
Expert Mod 10K+
P: 12,389
Try a delete query using Len().
Sep 6 '07 #5

P: 9
Sorry, what do you mean? If I choose delete query, where to key and what is the full command that I need to key?
Sep 6 '07 #6

P: 9
I finally got it, its len(FieldName) and =7 in criteria.

Thanks folks.

Just curious, how can I ask for 7 digits and 8 digits to be displayed together?

I tried "=7 and 8" it didn't work out...:)
Sep 6 '07 #7

Rabbit
Expert Mod 10K+
P: 12,389
You have to do Len() = 7 or Len() = 8
Or you could try Len() In (7,8)
Sep 6 '07 #8

P: 9
Thanks. The In(7,8) works well.

One more question please.

I have another database from someone else, his input is 1234 5678 but mine is 12345678, how can I remove that spacing in the middle?
Sep 7 '07 #9

Rabbit
Expert Mod 10K+
P: 12,389
You're looking for the replace function.
Sep 7 '07 #10

P: 9
Thanks.

I tried the wildcard *#* and it only display the alphabet, but why *?* doesn't display only numbers?
Sep 7 '07 #11

Rabbit
Expert Mod 10K+
P: 12,389
I'm not sure what you're talking about.

Replace(FieldName, " ", "") will remove all spaces in a string.
Sep 7 '07 #12

P: 9
Oh sorry, I did the replace and it works well. Thanks.

I am just trying out this wildcard # and ?.

I understand # means alphabet and ? means numbers. (Am I right?)

When I try a query the *#* works and only display the alphabet but the *?*didn't seems to work.
Sep 8 '07 #13

Rabbit
Expert Mod 10K+
P: 12,389
I'd have to see the whole SQL string.
Sep 8 '07 #14

Post your reply

Sign in to post your reply or Sign up for a free account.