Microsoft Access Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsDatabasesMicrosoft Access Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old April 21st, 2008, 05:07 PM
Birkofas Birkofas is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2008
Posts: 16 Birkofas User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 h 46 m 49 sec
Reputation Power: 0
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?

Reply With Quote
  #2  
Old April 21st, 2008, 11:03 PM
dykebert's Avatar
dykebert dykebert is offline
Contributing User
Click here for more information. Click here for more information
 
Join Date: Apr 2008
Posts: 300 dykebert User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 Days 2 h 48 m 27 sec
Reputation Power: 1
Sure.

In your crosstab queries, just use Left(postalcode, 3).

Select <field1>, <field2>, ..., Left(postalcode, 3) as shortCode, ...
From ....

Reply With Quote
  #3  
Old April 22nd, 2008, 04:06 AM
Birkofas Birkofas is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2008
Posts: 16 Birkofas User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 h 46 m 49 sec
Reputation Power: 0
Thanks dykebert it works .

Reply With Quote
  #4  
Old April 25th, 2008, 03:25 AM
Birkofas Birkofas is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2008
Posts: 16 Birkofas User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 h 46 m 49 sec
Reputation Power: 0
This code is working, but first part of postcode can be 2,3 and 4 char. How to solve that.

Reply With Quote
  #5  
Old April 25th, 2008, 09:13 AM
dykebert's Avatar
dykebert dykebert is offline
Contributing User
Click here for more information. Click here for more information
 
Join Date: Apr 2008
Posts: 300 dykebert User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 Days 2 h 48 m 27 sec
Reputation Power: 1
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?

Reply With Quote
  #6  
Old April 25th, 2008, 10:43 AM
Birkofas Birkofas is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2008
Posts: 16 Birkofas User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 h 46 m 49 sec
Reputation Power: 0
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

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesMicrosoft Access Development > UK's PostCodes


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
Stay green...Green IT