Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Remove spaces from postal code

Posted on 2014-03-03
3
Medium Priority
?
373 Views
Last Modified: 2014-03-03
How can I remove the spaces from the postal code as per the following?

These are Canadian post codes
A2B 4Y3
A2B4Y3

In the database a user can add the data both ways but on the Crystal report I want to show with no spaces.

The field name is: BVPOSTALCODE and it is a pervasive database
0
Comment
Question by:Gerhardpet
3 Comments
 
LVL 28

Assisted Solution

by:Bill Bach
Bill Bach earned 1000 total points
ID: 39901461
PSQL supports the REPLACE() function, which is used like this:
    SELECT REPLACE(BVPOSTALCODE,' ','') FROM tablename
0
 
LVL 23

Accepted Solution

by:
Ido Millet earned 1000 total points
ID: 39901535
Or if you wish to use a Crystal formula to do the cleanup,
Replace({BVPOSTALCODE}, " ", "")
0
 
LVL 1

Author Closing Comment

by:Gerhardpet
ID: 39901580
I needed the Crystal formula and both work.
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Instead of error trapping or hard-coding for non-updateable fields when using QODBC, let VBA automatically disable them when forms open. This way, users can view but not change the data. Part 1 explained how to use schema tables to do this. Part 2 h…
Creating a Cordova application which allow user to save to/load from his Dropbox account the application database.
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

879 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question