How to crop a postcode in Oracle 10g

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Rikkip
    New Member
    • Jun 2010
    • 2

    How to crop a postcode in Oracle 10g

    Hi,

    I'm using Oracle Discoverer 10G and im looking to use a calculation crop a postcode so that I can do a group sort by area.

    For example:

    Postcode: AB12 12A

    And I want Postcode: AB or AB12 returned in a new column.

    Any help would be appreciated.
  • Rikki Patel

    #2
    Solution to Postcode Crop

    I've now worked out how to do this!

    Using the 'Substr' calculation, SUBSTR(char,m[,n]), you can 'crop' a postcode or any other field for that matter.

    Where:
    Char is the Field Name
    m is the start point
    n is the number of characters after the start point

    For example :
    Postcode = IG10 9PG

    Apply Substring: Substr(postcode ,1,4)

    This would return: IG10

    Comment

    Working...