Focal Point
[solved]Date woes....

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

August 28, 2017, 09:49 AM
Trudy
[solved]Date woes....
I have two reports that use dates as parameters the first one works and is coded as follows
 
-SET &DAYLIM2=AYMD(&YYMD,+2,'I8YYMD');
-SET &DAYLIM1=AYMD(&YYMD,+1,'I8YYMD');

 


In the second one the user will select the date from an HTML page using a calendar control and the second parameter is derived from the first one. The code with the error message is below

 
-DEFAULTH DAYLIM1=&YYMD;
-SET DAYLIM2=AYMD(2017/08/07,+1,'I8YYMD');
0 ERROR AT OR NEAR LINE      6  IN PROCEDURE RoomCardsFOCEXEC *
(FOC36355) INVALID TYPE OF ARGUMENT #1 FOR USER FUNCTION AYMD
 

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


WF8
Windows
August 28, 2017, 10:27 AM
FP Mod Chuck
Hi Trudy

I think you need to edit the parameter coming in t strip off the '/'.

-SET &DAYLIMX = EDIT(&DAYLIM2,'9999$99$99');

Then do your calculation on &DAYLIMX


Thank you for using Focal Point!

Chuck Wolff - Focal Point Moderator
WebFOCUS 7x and 8x, Windows, Linux All output Formats
August 28, 2017, 12:35 PM
susannah
&YYMD.EVAL , +2 , 'I8'
its the .EVAL you need
'I8' works
'I8YYMD' works

in your 2nd example.
-DEFAULT &DAYLIM = &YYMD.EVAL ;
but it seems that your inbound value has /,
whereas &YYMD doesn't
so either change your default setting
-DEFAULT &DAYLIM = &DATEYYMD.EVAL ;
or change your inbound parms to be numeric, w/o the /
(as chuck says)




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
August 29, 2017, 11:49 AM
Hallway
On a side note, I noticed the following on the first line of the report output you posted with the error:
 -DEFAULTH DAYLIM1=&YYMD; 
Just so that you are aware, unfortunately you cannot use variables in a -DEFAULT or -DEFAULTH

EDIT: You can use a variable on a -DEFAULTH if you include a .EVAL at the end of the parameter. When running the following code:
-DEFAULT &TODAY_YYMD1 = &DATEYYMD.EVAL;
-DEFAULTH &TODAY_YYMD2 = &DATEYYMD;
-DEFAULTH &TODAY_YYMD3 = &DATEYYMD.EVAL;

-TYPE DEFAULT: &TODAY_YYMD1
-TYPE DEFAULTH: &TODAY_YYMD2
-TYPE DEFAULTH.EVAL: &TODAY_YYMD3 


I get the following output:
DEFAULT: &DATEYYMD.EVAL
DEFAULTH: &DATEYYMD
DEFAULTH.EVAL: 2017/08/29 

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


Hallway

 
Prod: 8202M1
Test: 8202M4
Repository:
 
OS:
 
Outputs: