Focal Point
[SOLVED] How to pass date values in UK Date format to ReportCaster?

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

July 21, 2020, 12:40 PM
Manoj
[SOLVED] How to pass date values in UK Date format to ReportCaster?
Hi,

I have a report built using InfoAssist. The report is on a Portal however we want to schedule output using ReportCaster (as users are interested in receiving a scheduled output). The report has a date range as a parameter, however, when automated using the tool, we would like to cover a rolling date range of a month.

Unfortunately, the scheduled report (using ReportCaster), the start date value of "DATEADD ( '&YYMD.EVAL' , 'D' , -30 )" and the end date value of "DATEADD ( '&YYMD.EVAL' , 'D' , -1 )" are throwing runtime errors

 
(FOC177) INVALID DATE CONSTANT: 43637
(FOC282) RESULT OF EXPRESSION IS NOT COMPATIBLE WITH THE FORMAT OF FIELD: Dfn_RangeStartDate_DMYY
(FOC177) INVALID DATE CONSTANT: 43666
(FOC282) RESULT OF EXPRESSION IS NOT COMPATIBLE WITH THE FORMAT OF FIELD: Dfn_RangeEndDate_DMYY
(FOC177) INVALID DATE CONSTANT: 43637
(FOC177) INVALID DATE CONSTANT: 43666
(FOC177) INVALID DATE CONSTANT: 43637
(FOC177) INVALID DATE CONSTANT: 43666


I have struggled to find out a solution for the above problem.

Any ideas will be hugely appreciated.

Kind regards,

Manoj.

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


Newbie.
WebFOCUS 8.2.0.3.
Client 8.2.0.4.
July 21, 2020, 01:39 PM
FP Mod Chuck
Manoj

This is just a guess but based on the field name Dfn_RangeStartDate_DMYY I think you are using the wrong variable in your DATEADD try using &DMYY


Thank you for using Focal Point!

Chuck Wolff - Focal Point Moderator
WebFOCUS 7x and 8x, Windows, Linux All output Formats
July 21, 2020, 02:11 PM
MartinY
quote:
Originally posted by Manoj:
... "DATEADD ( '&YYMD.EVAL' , 'D' , -30 )"

(FOC177) INVALID DATE CONSTANT: 43637

Your problem is that DATEADD returns a integer and not a date and your WHERE clause seems to look for a date.

YYMD, DMYY, ... should normally not cause issue when performing WHERE clauses; they are display format
But in case, try with the following:
DATETRAN(DTADD('&YYMD.EVAL', DAY, -30), '(DMYY)', '(/)', 'EN', 10, 'A10')

DATETRAN(DTADD('&YYMD.EVAL', DAY,  -1), '(DMYY)', '(/)', 'EN', 10, 'A10')



WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
July 22, 2020, 04:59 AM
Manoj
Many thanks, Chuck and Martin.

Martin, your solution is working without any issues. It should give me a different content (data) tomorrow which I shall confirm tomorrow. Meanwhile, thanks.

Kind regards,

Manoj.


Newbie.
WebFOCUS 8.2.0.3.
Client 8.2.0.4.
July 23, 2020, 06:53 AM
Manoj
Hi Martin,
I have re-tested the report this morning. Output files are generated without any error and with the expected data.
Thank you very much.
Kind regards,
Manoj.


Newbie.
WebFOCUS 8.2.0.3.
Client 8.2.0.4.