Focal Point
[SOLVED]Format comma, keeping dashes in date

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

May 11, 2010, 10:04 AM
Malinda
[SOLVED]Format comma, keeping dashes in date
I tried searching the documentation for this but couldn't find anything. I have output in which some of the columns are start and end dates. I formatted them YY-M-D. When output is to html the dashes remain. When I switch output to format comma for a csv file, it gets rid of the dashes in my file. Why is this and how do I keep it from doing this?

malinda

This message has been edited. Last edited by: Malinda,


WebFOCUS 7.6.11
Windows
all output (Excel, HTML, PDF)
May 11, 2010, 10:30 AM
Prarie
This is from the IBI site...may shed some light on your situation.

Smart Date fields will only store the numeric part of the date with no
formatting. When the date shows up in a styled report (HTML/PDF), the dates
is printed with formatting. Since a data hold file (CSV/ALPHA) is a data file
and not a formatted output, you are seeing just the 20090903 value.

There is a function called DATETRAN which will convert a smart date to an
alpha translation of the date. See this example:

DEFINE FILE CAR
RUN_DATE/MDYY=&MDYY;
DATE2/A10=DATETRAN(RUN_DATE, '(MDYY)', '(-)', 'EN', 10, DATE2)
END
TABLE FILE CAR
PRINT RUN_DATE DATE2
BY COUNTRY
ON TABLE HOLD AS CSVDATE FORMAT COM
END

This will convert the smart date RUN_DATE to a translated alpha date that
uses dashes for the delimitter.

If this is run and the output file is viewed with a text editor (like notepad),
the dashes will be seen. If the CSV file is opened using Excel, however,
Excel will apply it's own formatting for the date field.


In Focus since 1993. WebFOCUS 7.7.03 Win 2003
Date separators seem to be stripped out when sent to a COMM/COMMT file. Try creating your own formatted "date" as an alpha field with all the pieces you need. It requires more work, I know, but it may be the way to go unless there is some setting out there of which I'm not aware.



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
Oh, Prarie just beat me Cool ! Malinda, Prarie's example clearly explains and shows the fact that you need to make your date an alpha field and then you'll have full control.



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
Perfect, I was thinking the alpha was they way I was gonna have to go but was hoping for an easier way. Oh well thanks for the help everyone!


WebFOCUS 7.6.11
Windows
all output (Excel, HTML, PDF)