Focal Point
date

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

July 18, 2005, 08:28 PM
<RBC007>
date
Another newbie quesiton ... This is very basic however I have to ask, because I'm new to this. I need help with a Daily Business week (M-F)report that will calculate the date for yesterday something like the example below that is a weekly fomula.
SET BUSDAY = _MTWTF_
DEFINE FILE TABLENAME
CDATE/YYMD=&YYMD;
NDATE/YYMD=DATEADD ( CDATE, 'D', -5 );BDATE/YYMD=DATEMOV ( NDATE, 'BOW' );EDATE/YYMD=DATEMOV ( NDATE, 'EOW' );
END WHERE ( ONDATE GE BDATE AND
ONDATE LE EDATE );
After reading the links, I still need help.....
https://forums.informationbuilders.com/eve/forums/a/...201067331#5201067331 https://forums.informationbuilders.com/eve/forums/a/...631097331#3631097331

This message has been edited. Last edited by: <Mabel>,
July 18, 2005, 08:33 PM
Francis Mariani
If you're trying to calculate yesterday's date from a YYMD date field, all you have to do is subtract 1 from the date.

SET BUSDAY = _MTWTF_

DEFINE FILE CAR
CDATE/YYMD=&YYMD;
NDATE/YYMD=DATEADD ( CDATE, 'D', -5 );
BDATE/YYMD=DATEMOV ( NDATE, 'BOW' );
EDATE/YYMD=DATEMOV ( NDATE, 'EOW' );
YDATE/YYMD=CDATE-1;
END

TABLE FILE CAR
PRINT COUNTRY CDATE NDATE BDATE EDATE YDATE
WHERE RECORDLIMIT EQ 1
END
July 18, 2005, 09:38 PM
<RBC007>
(last business day)

Francis thanks for your help... and yes thats it, however I might not have said/suggested Business days.

As today is "Mondays" The report should reflect the values for Friday (last business day) as it currently shows values for Sunday (previous day).

DEFINE FILE CAR
CDATE/YYMD=&YYMD;
YDATE/YYMD=CDATE-1;
END


WHERE ( ONDATE EQ YDATE );
July 19, 2005, 11:31 AM
Tony A
Hi RBCanada,

You need the follwing change to achieve what you require -

SET BUSDAY = _MTWTF_

DEFINE FILE CAR
CDATE/YYMD='2005/07/18';
NDATE/YYMD=DATEADD ( CDATE, 'D', -5 );
BDATE/YYMD=DATEMOV ( NDATE, 'BOW' );
EDATE/YYMD=DATEMOV ( NDATE, 'EOW' );
YDATE/YYMD=DATEADD(CDATE,'WD',-1);
END

TABLE FILE CAR
PRINT COUNTRY CDATE NDATE BDATE EDATE YDATE
WHERE RECORDLIMIT EQ 1
END

My contract finishes in Sept, I'm open to offers for that time onwards Smiler S.C. has my contact details if he's still there!!