hi all... i have some questions about date format
1. how to read 20100614 to be read as a date?
2. if there is no data , i want it is filled by date of today
is it correct to be like this?
IF STRLEN(DocumentDateText)=0 THEN
EVALUATE(DocumentDate,'TODAY')
ELSE
EVALUATE(DocumentDate,DocumentDateText);
Thanks
Answers
Kashyap
i just want to import data 20100614 to nav
Try to use function DMY2DATE.
But you need to cut and covert to integer your string before.
regards,
Depro
you mean separate with 3 strings ??
20100614 become
string1 --> 2010
string2 --> 06
string3 --> 14
is it like this?
need some clearification.
describe your code here with trigger name.
I am trying to import data
the data is like this --> 20100614
20100614 (YYYYMMDD)
i'm using report
Report - OnPostReport()
DocumentDate := 101310D;
DocumentDateText1 := FORMAT(DocumentDate,0,'<Year4><Month,2><Day,2>');
MESSAGE('%1',DocumentDateText1);
--> it will show you 20101013
so... how to reverse it?
from 20101013 became read in date type
the easy way , create a function as follow ....
e.g. ConvertDate(DocumentDateText : Text[50]) : Date
EVALUATE(vYear,COPYSTR(DocumentDateText,1,4));
EVALUATE(vMonth,COPYSTR(DocumentDateText,5,2));
EVALUATE(vDay,COPYSTR(DocumentDateText,7,2));
EXIT(DMY2DATE(vDay,vMonth,vYear));
is it valid for comp using DDMMYYYY and MMDDYYY ???
or should i set the comp to be DDMMYYYY ?
DMY2Date is a function that will create a date from you day, month and year.
So the system will show you the date, in the format that is already set.
So dont worry, if your format is set to DDMMYYYY or MMDDYYYY then the system will show you date like 14/06/10 or 06/14/10 respectively...!!!
Kashyap
those codes working !!
thanks all
FORMAT(TODAY,0,'<Year4><Month,2><Day,2>') --> today
how to get like this 01012010123055 -> date + time
thanks
thanks