Options

Evaluate Date type in RTC

julkifli33julkifli33 Member Posts: 1,073
edited 2012-04-16 in NAV Three Tier
hi all i have code like this
//Invoice Date
EBuf.RESET;
EBuf.SETRANGE(EBuf."Row No.",RecNo);
EBuf.SETRANGE(EBuf."Column No.",7);
IF EBuf.FIND('-') THEN
EVALUATE(InvoiceDate,EBuf."Cell Value as Text");

it works fine in classic
but when i test it in RTC there is an error message
01/03/2012 12:00 AM is not a valid date

i think it's because 12:00 AM
how to remove it ?
thanks

Answers

  • Options
    stevedivimaststevedivimast Member Posts: 39
    I got the same error last week
    Use a Datetime variable in evaluate instruction instead of Date type, then use c/al function to get the date.
  • Options
    julkifli33julkifli33 Member Posts: 1,073
    I got the same error last week
    Use a Datetime variable in evaluate instruction instead of Date type, then use c/al function to get the date.

    then how do i insert it to date type
    let's say i have posting date in sales header
    it can be inserted.... because date and datetime is different
  • Options
    stevedivimaststevedivimast Member Posts: 39
    Change your code like this (InvoiceDateTime is a DateTime type)


    EBuf.RESET;
    EBuf.SETRANGE(EBuf."Row No.",RecNo);
    EBuf.SETRANGE(EBuf."Column No.",7);
    IF EBuf.FIND('-') THEN
    EVALUATE(InvoiceDateTime,EBuf."Cell Value as Text");
    InvoiceDate := DT2DATE(InvoiceDateTime);
  • Options
    julkifli33julkifli33 Member Posts: 1,073
    Change your code like this (InvoiceDateTime is a DateTime type)


    EBuf.RESET;
    EBuf.SETRANGE(EBuf."Row No.",RecNo);
    EBuf.SETRANGE(EBuf."Column No.",7);
    IF EBuf.FIND('-') THEN
    EVALUATE(InvoiceDateTime,EBuf."Cell Value as Text");
    InvoiceDate := DT2DATE(InvoiceDateTime);

    hi stevedivimast
    it works!
    thanks a lot :) \:D/
Sign In or Register to comment.