Focal Point
Variable date format
April 15, 2008, 03:33 PM
JOEVariable date format
I have a report that that uses a web form for start and stop date criteria selection. The dates appear correct on the web form's combobox - "mm/dd/yyy" format. However, when placing the &dte and &edte for start and stop dates on the report header it displays a string - ex. 04012008. I read some info on using the set command but I'm not too familar with it. Any ideas if using the set command would lead in the right direction.
Thanks,
Joe
WebFocus 7.7.02 WinXP
April 15, 2008, 03:52 PM
Francis MarianiJoe,
The quickest way would be to simply use the Dialogue Manager EDIT command:
-SET &dte = '04012008';
-SET &dtex = EDIT(&dte,'99/99/9999');
-TYPE &dte &dtex
Place the edited date in the heading.
Francis
Give me code, or give me retirement. In FOCUS since 1991
Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
April 15, 2008, 03:53 PM
susannahJoe
sounds like you would enjoy some basic training..things like Dialogue Manager.
Make sure you have a copy of the USING FUNCTIONS manual...
try this
-SET &MYYEAR=EDIT(&DTE,'$$$$9999');
-SET &MYMONTH=EDIT(&DTE,'99');
-SET &MYDAY=EDIT(&DTE,'$$99');
-SET &MYDTE=&MYDAY |'-' | &MYDAY | '-' | &MYYEAR ;
...or this
-SET &MYDAT = EDIT(&DTE,'99/99/9999');
then in your heading
HEADING
" &MYDAT "
... make sure you download the USING FUNCTIONS manual...
Come to Summit and get Gerry to autograph it for you.
| In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID |
April 15, 2008, 04:06 PM
JOEI ended up doing this. I do not know if it is correct or not but I read up on the -set command.
-SET &dte = EDIT(&dte, '99/99/9999');
-SET &edte = EDIT(&edte, '99/99/9999');
I will try the other examples to learn from as well. Thanks for all your replies. The more I use this tool the more familar I'm becoming with it.
Joe
WebFocus 7.7.02 WinXP
April 15, 2008, 04:11 PM
susannahwell, Joe thats not a good idea if the &vars
&dte and &edte are used in the WHERE statements..
because you've changed their value.
When u want a
display version of some &var, its best to create a
new one..
and its good practice to develop a standard syntax you'll always use for display versions of variables..will always make complex code easier for you to read years later..
or for me, hours later
maybe prefix them all...
-SET &D_DTE = EDIT(&dte,...);
| In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID |
April 15, 2008, 05:43 PM
Francis Mariani-SET &dtex = EDIT(&dte,'99/99/9999');
Joe, my example specifically uses a new DM variable.
Francis
Give me code, or give me retirement. In FOCUS since 1991
Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
April 16, 2008, 10:41 AM
JOEThanks for the tips. I understand now. I took Francis advice and it worked perfectly.
Joe
WebFocus 7.7.02 WinXP