Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi guys,
I got two dates
set d = 3/16/2014 4:26:55 PM
set d1 = 2014-03-16 16:26:55
I need to compare them.
I tried few things
if (Date($(d)) < Date($(d1)) // gives script line error
if ( $(d )< $(d1)) then // gives script line error
if ( (d )< (d1)) then // even though both dates are same it returns true.
Please help me with it.
Regards,
Saurabh
SET ThousandSep=',';
SET DecimalSep='.';
SET MoneyThousandSep=',';
SET MoneyDecimalSep='.';
SET MoneyFormat='$#,##0.00;($#,##0.00)';
SET TimeFormat='hh:mm:ss';
SET DateFormat='YYYY-MM-DD';
SET TimestampFormat='YYYY-MM-DD hh:mm:ss[.fff]';
SET MonthNames='Jan;Feb;Mar;Apr;May;Jun;Jul;Aug;Sep;Oct;Nov;Dec';
SET DayNames='Mon;Tue;Wed;Thu;Fri;Sat;Sun';
let d = num(timestamp#('3/16/2014 4:26:55 PM','M/D/YYYY h:m:s TT'));
let d1 = num('2014-03-16 16:26:55');
if $(d)<$(d1) then
let vCompare='d minor than d1';
exit script;
ENDIF
let vCompare='d Equal or bigger than d1';
exit script;
hello, first of all i sugest you to unify the date format management according the format variables you have defined in your script
check this example
SET ThousandSep=',';
SET DecimalSep='.';
SET MoneyThousandSep=',';
SET MoneyDecimalSep='.';
SET MoneyFormat='$#,##0.00;($#,##0.00)';
SET TimeFormat='hh:mm:ss';
SET DateFormat='YYYY-MM-DD';
SET TimestampFormat='YYYY-MM-DD hh:mm:ss[.fff]';
SET MonthNames='Jan;Feb;Mar;Apr;May;Jun;Jul;Aug;Sep;Oct;Nov;Dec';
SET DayNames='Mon;Tue;Wed;Thu;Fri;Sat;Sun';
let d = num(timestamp#('3/16/2014 4:26:55 PM','M/D/YYYY h:m:s TT'));
let d1 = num('2014-03-16 16:26:55');
if $(d)<$(d1) then
let vCompare='d minor than d1';
exit script;
ENDIF
let vCompare='d Equal or bigger than d1';
exit script;
Hi,
Try like this
LET d = Timestamp(Timestamp#('3/16/2014 4:26:55 PM', 'M/D/YYYY h:m:s TT'))
LET d1 = Timestamp(Timestamp#('2014-03-16 16:26:55', 'YYYY-MM-DD hh:mm:ss'))
Now use this variables in script like this
if ( $(d )< $(d1))
Hope this helps you.
Regards,
Jagan.