473,322 Members | 1,806 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

How to crop a postcode in Oracle 10g

2
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.
Jun 25 '10 #1

✓ answered by Rikki Patel

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

1 2541
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
Oct 26 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Lapchien | last post by:
I have a field for a postcode. I'd like another field to auto contain an 'area' number, based on the first part (only) of the postcode. For example, if a postcode LS4 4DJ was entered, another...
3
by: ACaunter | last post by:
Hi there, I was wondering if there was a way to crop a peice of an ASP.Net Image, allowing the user to zoom in on only a section of the picture?? any help would be appreciated!! thanks --...
5
by: Alan | last post by:
Hi, I'm getting as bit confused with my queries. I simply (!) want to insert a space into a postcode field the 4th character from the right, so, for example, ML201TQ becomes ML20 1TQ, which is...
6
by: Julian | last post by:
Hi, I am a very beginner in databases. I created a database table in Access 2003 and OOo 2.03 that includes name, address, postcode, phone numbers etc of our customers. I would like to sort...
3
by: mark | last post by:
I have a table of UK companies whose records I want to filter using a map of postcode regions. For the benfit of people outside the UK, our postcodes are a pain to work with because they are not...
5
by: dreadnought8 | last post by:
I've worked with mdbs, and with SQL Server to a lesser extent, with Access as a front end, on commercial-strength systems for quite a while, starting with A97. The last 8 months or so, I've been...
5
by: billynastie2007 | last post by:
Hi i am writing a balloon race site and i am having problems with some functions to calculate the distance the balloon travels firstly i am reading my info from the database using the fetch assoc...
0
by: Pinna | last post by:
Hiya, I am trying to select based on a range on postcode on a table. The field POSTCODE is a varchar2(8). The problem is when refinng on 'where postcode between 'PE1' and 'PE29'', because this is...
12
alakazamm
by: alakazamm | last post by:
I am building a database on Access 2000 which include a Customer Details table. In this Customer Details table there is a 'Post Code' field which I am required to make an Input Mask to limit the...
1
by: amanym | last post by:
hi all, i have abig problem in oracle 7.3.4.0.0 the problem is ORA-01033 ORACLE initialization shutdown in progress , i try to use svrmgrl tool & sqlplus the result the same error (ORA-01033...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.