Focal Point
[CLOSED]Date Format

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

October 04, 2016, 11:39 PM
Lou Palomo
[CLOSED]Date Format
The date field is A8 (10/01/15)

created 2 date define fields to allow the user to enter a from and to date parameter

START_DT_FR/A8= Start Date Field in File

START_DT_TO/A8= Start Date Field in File

When I run the report and prompts for dates
Promtp1 - 10/01/15
Prompt2 - 10/30/15

when the data is returned it is including dates in 2016 -ex: 10/04/16

Please help, user request to run report with from and to dates as parameters.

Thanks,
Lou

This message has been edited. Last edited by: <Emily McAllister>,


WebFOCUS 8
Windows, All Outputs
October 04, 2016, 11:57 PM
Waz
Can you post the code ?


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

October 05, 2016, 01:59 AM
Lou Palomo
ENGINE INT CACHE SET ON


-*COMPONENT=Define_prmwowf16
DEFINE FILE gwa_iseries/prmwowf16
CM_START_DT_FR/A8=PRMWOWF16.PRMWOWF16.WASTRT ;
CM_START_DT_TO/A8= PRMWOWF16.PRMWOWF16.WASTRT ;
END
-DEFAULTH &WF_SUMMARY='Summary';
-DEFAULTH &WF_TITLE='WebFOCUS Report';
TABLE FILE gwa_iseries/prmwowf16
BY PRMWOWF16.PRMWOWF16.WADOCO
BY PRMWOWF16.PRMWOWF16.WADL01
BY PRMWOWF16.PRMWOWF16.WAWR0901
BY PRMWOWF16.PRMWOWF16.WAANP01
BY PRMWOWF16.PRMWOWF16.WASTRT
BY PRMWOWF16.PRMWOWF16.WBSRDS
BY PRMWOWF16.PRMWOWF16.WAANSA
BY PRMWOWF16.PRMWOWF16.WAANSA01
BY PRMWOWF16.PRMWOWF16.WASRST
WHERE PRMWOWF16.PRMWOWF16.WADCTO EQ 'WO';
WHERE PRMWOWF16.PRMWOWF16.WASRST LT '75';
WHERE PRMWOWF16.PRMWOWF16.WAWR0901 EQ &WAWR0901.(OR(<.>,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, |FORMAT=A30)).Village:.;
WHERE CM_START_DT_FR GE &CM_START_DT_FR. (|FORMAT=A8).From Start Date MM/DD/YY.QUOTEDSTRING;
WHERE CM_START_DT_TO LE &CM_START_DT_TO. (|FORMAT=A8).To Start Date MM/DD/YY.QUOTEDSTRING;
ON TABLE SUBHEAD
"Permits Open Work Order"
ON TABLE PCHOLD FORMAT &WFFMT.(,,,,,,,,).Select an output type.

ON TABLE NOTOTAL
ON TABLE SET CACHELINES 100
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE SET SQUEEZE ON
ON TABLE SET HTMLCSS ON
ON TABLE SET HTMLENCODE ON
ON TABLE SET EMPTYREPORT ON
ON TABLE SET GRWIDTH 1
ON TABLE SET STYLE *
INCLUDE=IBFS:/FILE/IBI_HTML_DIR/javaassist/intl/EN/combine_templates/ENTeal_Light1.sty,$
TYPE=REPORT, TITLETEXT=&WF_TITLE.QUOTEDSTRING, SUMMARY=&WF_SUMMARY.QUOTEDSTRING, HFREEZE=OFF, $
TYPE=TABHEADING, LINE=1, JUSTIFY=CENTER, $
TYPE=TABHEADING, LINE=1, ITEM=1, OBJECT=TEXT, SIZE=12, STYLE=BOLD+ITALIC, $
ENDSTYLE
END

-RUN


WebFOCUS 8
Windows, All Outputs
October 05, 2016, 03:21 AM
Tony A
Lou,

You are comparing alphanumeric values not dates, so 10/04/16 does indeed fall between 10/01/15 and 10/30/15.

If you want proof of this then enter the following into MS Excel and then sort as TEXT. Be sure to include the leading single quote -

'10/01/15
'10/30/15
'10/04/16


To be effective when managing selections like this, you really need to convert the alpha values to proper dates. The only problem when using an RDBMS is that sometimes the clause does not get converted to SQL and so it can be inefficient. So choose your conversion function with care!

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10