From an Access 2000 table of Postal Codes, I am trying to run a query will display the minimum and maximum ranges of the postal codes, but not include any invalid ranges in the min & max.
Example:
[POSTAL_CODE]
V6M0A1
V6M1A0
V6M1A1
V6M1A2
V6M1A3
V6M1A4
V6M1A5
V6M1A6
V6M1A7
V6M1A8
V6M1A9
V6M1B2
V6M1B3
V6M1B4
V6M1B7
V6M1B8
V6M1B9
V6M1C1
V6M1C2
V6M1C3
V6M1C4
V6M1C5
V6M1C7
V6M1C8
V6M1C9
The result required is:
Min Max
V6M0A1 V6M0A1
V6M1A0 V6M1A9
V6M1B2 V6M1B4
V6M1B7 V6M1B9
V6M1C1 V6M1C5
V6M1C7 V6M1C9
I have tried grouping on a formula:
Left ({POSTAL_CODE},5 )
and then using min & max grouping but the resulting ranges then include
values that don’t exist:
Min Max
V6M0A1 V6M0A1
V6M1A1 V6M1A9
V6M1B2 V6M1B9 (V6M1B5 & V6M1B6 do not exist)
V6M1C1 V6M1C9 (V6M1C6 does not exist)
Here is the SQL view of my current query:
SELECT Left(
![POSTAL_CODE],5) AS Expr1, Min(TABLE].POSTAL_CODE) AS MinOfPOSTAL_CODE, Max(
.POSTAL_CODE) AS MaxOfPOSTAL_CODE
FROM
GROUP BY Left(
![POSTAL_CODE],5);
Can anyone steer me in the right direction?
Example:
[POSTAL_CODE]
V6M0A1
V6M1A0
V6M1A1
V6M1A2
V6M1A3
V6M1A4
V6M1A5
V6M1A6
V6M1A7
V6M1A8
V6M1A9
V6M1B2
V6M1B3
V6M1B4
V6M1B7
V6M1B8
V6M1B9
V6M1C1
V6M1C2
V6M1C3
V6M1C4
V6M1C5
V6M1C7
V6M1C8
V6M1C9
The result required is:
Min Max
V6M0A1 V6M0A1
V6M1A0 V6M1A9
V6M1B2 V6M1B4
V6M1B7 V6M1B9
V6M1C1 V6M1C5
V6M1C7 V6M1C9
I have tried grouping on a formula:
Left ({POSTAL_CODE},5 )
and then using min & max grouping but the resulting ranges then include
values that don’t exist:
Min Max
V6M0A1 V6M0A1
V6M1A1 V6M1A9
V6M1B2 V6M1B9 (V6M1B5 & V6M1B6 do not exist)
V6M1C1 V6M1C9 (V6M1C6 does not exist)
Here is the SQL view of my current query:
SELECT Left(
FROM
GROUP BY Left(
Can anyone steer me in the right direction?