Query to correct telephone numbers mobile and then landline (1 Viewer)

Number11

Member
Local time
Today, 06:32
Joined
Jan 29, 2020
Messages
607
So i need to run a query to correct the telephone numbers within two fields

Mobile

Landland

due to the many data sources sometime we have a landline within the mobile field and the mobile within landline. i need to have access do a final clean-up and move the number to the correct file. so thinking of creating a new temp table and use append query not not 100% that's the best solution anyone got any ideas
 

Gasman

Enthusiastic Amateur
Local time
Today, 06:32
Joined
Sep 21, 2011
Messages
14,299
Mobiles begin with 07 in the UK ?
So examine a field, and if you have to move the data, swap the data.

You have already been given code to examine a portion of a string.
 

MajP

You've got your good things, and you've got mine.
Local time
Today, 01:32
Joined
May 21, 2018
Messages
8,529
I would do like you said, but it could be done in code looping the recordset.
Create a query that returns those that are switched.
left([mobile],2) <> "07" and left([landline]2) = 07
You can use this to do make table query saving the ID, old mobile and old landline.
Then you can do an update query setting the mobile to old landline, and landline to old mobile.

In code you loop the records of the query where the numbers are incorrect.
save the mobile to a variable first
(or you can save the landline, but one has to be saved in memory before updating the other)
Update the mobile to the old landline number
update the landline to the stored variable.
 

MajP

You've got your good things, and you've got mine.
Local time
Today, 01:32
Joined
May 21, 2018
Messages
8,529
Also be happy the UK rules are simple. See this thread on the Austrian rules. and trying to do something similar.
 

Users who are viewing this thread

Top Bottom