Convert datetime to date via 4GL

SOLVED

Is there a way convert a Datetime value to Date type in the 4GL language? I need to compare a date with a datetime variable in 4GL but it does not work. Therefore, I would need to convert the datetime to a date. 

Parents
  • 0
    verified answer

    Hi Chris:

    In the AFNC script, there are two functions that could help you. Try this in the calculator:


    func AFNC.DATE_FROM_DT(datetime$) -> It will return the date from a datetime value
    func AFNC.TIME_FROM_DT(datetime$) -> It will return a string value with this format: HH:MM:SS

    The parameter must be a “Datetime” variable.

    it's frustrating that SAGE doesn’t provide a good documentation about this libraries.

    I hope it helps you.

    Thanks,

    Nacho.

Reply
  • 0
    verified answer

    Hi Chris:

    In the AFNC script, there are two functions that could help you. Try this in the calculator:


    func AFNC.DATE_FROM_DT(datetime$) -> It will return the date from a datetime value
    func AFNC.TIME_FROM_DT(datetime$) -> It will return a string value with this format: HH:MM:SS

    The parameter must be a “Datetime” variable.

    it's frustrating that SAGE doesn’t provide a good documentation about this libraries.

    I hope it helps you.

    Thanks,

    Nacho.

Children