Focal Point
Amper Variable Date

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

July 21, 2005, 04:14 PM
Ginny
Amper Variable Date
I have a report where I am doing a search on the date range. The date is stored in sql server as dd/mm/yyyy. When the report parameter prompts the user for the date they have to put in the date as yyyy/mm/dd. The real problem with this is that I have this variable in the heading and so the heading now says from 2005/07/01 to 2005/07/30. They really want it to say from 07/01/2005 to 07/30/2005. I have changed the format of the field so it shows up in the report as the correct order, but cannot find a way to convert the amper variable to show this way.

Any ideas?
July 21, 2005, 04:19 PM
k.lane
Assuming the two dates entered are &DATE1 and &DATE2, use something like the following:

DEFINE FILE CAR
DT1_YYMD/YYMD = '&DATE1' ;
DT2_YYMD/YYMD = '&DATE2' ;
DT1_MDYY/MDYY = DT1_YYMD ;
DT2_MDYY/MDYY = DT2_YYMD ;
END

TABLE FILE CAR
HEADING
"FROM <DT1_MDYY TO <DT2_MDYY"
...
END

Ken
July 21, 2005, 04:25 PM
Francis Mariani
The easiest way to change the positions of date elements in a Dialog Manager variable is to use the EDIT function:

-SET &INDATE = '2005/07/31';
-SET &INDATE1 =
- EDIT(&INDATE,'$$$$$99$$$') | '/' |
- EDIT(&INDATE,'$$$$$$$$99') | '/' |
- EDIT(&INDATE,'9999$$$$$$');
-TYPE &INDATE - &INDATE1

There's all kinds of date functions you could use, but this is the easiest method.
July 21, 2005, 04:39 PM
reFOCUSing
Here is another way:
-SET &DT_YYMD = '2005/07/21';
-SET &DT = EDIT(&DT_YYMD,'9999$99$99');
-SET &DT = CHGDAT(YYMD,MDYY,&DT,'A8');
-SET &DT_MDYY = EDIT(&DT,'99/99/9999');
-TYPE DT_YYMD: &DT_YYMD
TYPE DT_MDYY: &DT_MDYY

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