Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Help!!! Format Mask in Report 2.5
How about creating a view which will serve as the base table/view for your report. The view would be defined as follows:
create view view_name as
select substr(to_char(social_security), 1, 3) || '-' || substr(to_char(social_security), 4, 2) || '-' || substr(to_char(social_security), 6, 4)from table_name;
Note that I'm assuming that the social_security field is a number. If not, just take out the to_char. And, of course, add any other fields you need. Now, just base your report on the view, and you'll have your social security number formatted like you want on the report.
I can't take credit for this, however. We were looking at the same problem just a couple of days ago, and my co-worker (Jason Ford) came up with the solution.
Grue
hnguyen_at_os.dhhs.gov wrote in article
<884960752.960692235_at_dejanews.com>...
> Hi all,
>
> I have a stupid question about Format Mask for a
> field in report 2.5. I have a field Social Security
> in my table. The data type is VARCHAR2(9). I want to
> display the data that looks like 111-22-3333 in my
> report instead of 111223333. Please help me to solve
> this problem.
>
> My email is hnguyen_at_os.dhhs.gov
>
> Thanks in advance.
>
> Hiep Nguyen
>
>
> -------------------==== Posted via Deja News ====-----------------------
> http://www.dejanews.com/ Search, Read, Post to Usenet
>
Received on Fri Jan 16 1998 - 00:00:00 CST