|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
UK's PostCodes
I am new in database coding and have few questions.
In addresses tables i have full PostCode, in crosstab reports I need see just first part from 3 or 4 characters of postcode. Could you help me sort out that problem? |
|
#2
|
||||
|
||||
|
Sure.
In your crosstab queries, just use Left(postalcode, 3). Select <field1>, <field2>, ..., Left(postalcode, 3) as shortCode, ... From .... |
|
#3
|
|||
|
|||
|
Thanks dykebert it works
. |
|
#4
|
|||
|
|||
|
This code is working, but first part of postcode can be 2,3 and 4 char. How to solve that.
|
|
#5
|
||||
|
||||
|
I'm not familiar with your post codes is there something that delineates the first part from the rest? If it's consistent like a "-" you can use it like so.
Select <field1>, <field2>, ..., Left(postalcode, instr(postcode, "-") -1) as shortCode, ... From .... If it's not consistent is there a small set of possible delineators? |
|
#6
|
|||
|
|||
|
PostCodes in UK looks like LLNS3LL
L - letter N-number S space N2 4NK or NN2 4NK, NW2B 5GH the code is exactly what I need. Thanks again ![]() |
![]() |
| Viewing: Dev Articles Community Forums > Databases > Microsoft Access Development > UK's PostCodes |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|