G
Guest
THE PROBLEM
I have a master ‘Runs’ Table listing regular vehicle runs on a ‘from’ – ‘to’
basis.
For example:
Runs_Table
Run_No (Autonumber Index)
Run_From (Address)
[From_PCode] (Postcode)
Run_To (Address)
[To_PCode] (Postcode)
[Run_No] [Run_From] [From_Pcode] [Run_To] [To_PCode]
6 Sub Depot W2 Main Depot W2
8 Big Farm SW9 Little Farm SW9
Along the vehicle’s run are 8 (regular) delivery points stored in a table
called Run_Points (linked by the ‘Run_No’ field)
The format is
Run_No
point_Venue_A
point_Address_A
point_Venue_B
point_Address_B
And so on… (upto 8 pairs)
The Field containing the Address also contains the postcode which is
separated by a comma.
For example:
[point_Venue_A] [point_Address_A] [point_Venue_B] [point_Address_B]
Post Office High St, W2 Civic Centre South
St, W2
Hospital East St, SW9 School Main
St, SW9
What I want to do
I want to be able to run a query/process that takes the 2 main postcodes
from the Run tables and looks up the various corresponding Postcodes in other
points runs to let the user know that while on that run, there are other
locations close by with the same postcode, albeit on a different run, that he
may want to deliver to.
The problem is that the postcode is within the same field as the address,
but separated by a (hopefully) useful comma. Does anyone know how I would go
about parsing this data, or building a suitable query to do the job?. I
realise the simplest way would be to separate the Run_Points postcodes, but
if I were to do that, the whole database would need a re-write (a task that
fills me with dread).
I have a master ‘Runs’ Table listing regular vehicle runs on a ‘from’ – ‘to’
basis.
For example:
Runs_Table
Run_No (Autonumber Index)
Run_From (Address)
[From_PCode] (Postcode)
Run_To (Address)
[To_PCode] (Postcode)
[Run_No] [Run_From] [From_Pcode] [Run_To] [To_PCode]
6 Sub Depot W2 Main Depot W2
8 Big Farm SW9 Little Farm SW9
Along the vehicle’s run are 8 (regular) delivery points stored in a table
called Run_Points (linked by the ‘Run_No’ field)
The format is
Run_No
point_Venue_A
point_Address_A
point_Venue_B
point_Address_B
And so on… (upto 8 pairs)
The Field containing the Address also contains the postcode which is
separated by a comma.
For example:
[point_Venue_A] [point_Address_A] [point_Venue_B] [point_Address_B]
Post Office High St, W2 Civic Centre South
St, W2
Hospital East St, SW9 School Main
St, SW9
What I want to do
I want to be able to run a query/process that takes the 2 main postcodes
from the Run tables and looks up the various corresponding Postcodes in other
points runs to let the user know that while on that run, there are other
locations close by with the same postcode, albeit on a different run, that he
may want to deliver to.
The problem is that the postcode is within the same field as the address,
but separated by a (hopefully) useful comma. Does anyone know how I would go
about parsing this data, or building a suitable query to do the job?. I
realise the simplest way would be to separate the Run_Points postcodes, but
if I were to do that, the whole database would need a re-write (a task that
fills me with dread).