• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 229
  • Last Modified:

adding numbers in a query

I have mobile number in a access table in field named "mobile". I need to run a query to remove the "0" from the beginning and then add "0044"
0
oldmillsaddlery
Asked:
oldmillsaddlery
  • 2
  • 2
1 Solution
 
sdstuberCommented:
select mid$(mobile,2) + '0044' from yourtable
0
 
sdstuberCommented:
my first post assumes every number has a leading 0

if you meant, you want to add 0044 only if there is a leading 0 and otherwise leave it alone
try something like this..


SELECT iif(left(mobile,1) = '0',mid$(mobile,2) + '0044', mobile)
FROM yourtable;
0
 
oldmillsaddleryAuthor Commented:
I have tried the following but it adds 0044 at the end of the number instead of the beginning
0
 
oldmillsaddleryAuthor Commented:
This is the code i used

SELECT Mid$(mobile,2)+'0044' AS Expr1, TXT.Mobile
FROM TXT;
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now