Focal Point
Changing format on the go......

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/1251038331

February 22, 2005, 01:14 PM
webfocuspgm
Changing format on the go......
I have two types of records - "P" and "S". Each of these have an amount field. If the record is a "P" record I want my amount field to be displayed with commas and a $ sign. If the record is an "S" record I want the amount field to be displayed with only commas - NO $ sign. Can anyone give me an example of how this is done.... Thanks so much ......
February 22, 2005, 01:55 PM
reFOCUSing
Here is come code that should help you:<br />
DEFINE FILE CAR
FMT/A8 = IF RETAIL_COST GE 10000 THEN 
'D12.2' ELSE 'D12.2M';
END
-RUN
TABLE FILE CAR
SUM
RETAIL_COST
RETAIL_COST/FMT
BY COUNTRY
BY CAR
END
You can
change the if statement to look
for P's and S's.

This message has been edited. Last edited by: <Mabel>,
February 22, 2005, 02:05 PM
webfocuspgm
Thanks so much CurtisA..... I was trying to put the entire RETAILCOST/D12.2C in the define..... I didn't even think about just doing the Format.........
February 22, 2005, 03:12 PM
reFOCUSing
Report painter also has no problem with creating dynamic field formats this way too.
February 22, 2005, 06:07 PM
webfocuspgm
Report Painter.... Right click on field, select dynamic and then select the FMT ( or whatever name you gave the already defined field) .......

Took me a little bit but I found it - if in fact this is how you would have done it .... thanks for the tip that Report Painter does this too...... I'm just starting to use Report Painter it's amazing all the things it can do........ Cool

and my user is very happy I could accomodate her particular formatting issue......