Convert Date To Text

CHEMINTELCHEMINTEL Member Posts: 15
edited 2005-06-02 in Navision Attain
Hello:

I need to filter by posting date the item ledger entry table, but I try with this code:

ITEMLEDGERENTRY.SETFILTER(ITEMLEDGERENTRY."POSTING DATE", ''<=JOBJNLLINE."POSTING DATE"')
The error message says that "JOBJNLLINE."POSTING DATE" it´s not a valid date
I need to conver JOBJNLLINE."POSTING DATE" to a text? or are there another way to filter it?

Thanks

Comments

  • DenSterDenSter Member Posts: 8,307
    CHEMINTEL wrote:
    ITEMLEDGERENTRY.SETFILTER(ITEMLEDGERENTRY."POSTING DATE", ''<=JOBJNLLINE."POSTING DATE"')
    You are trying to put the literal string <=JOBJNLLINE."POSTING DATE" into a date field, so of course Navision will let you know that you can't do that. Try this instead:
    ITEMLEDGERENTRY.SETFILTER("Posting Date",'<=%1',JOBJNLLINE."Posting Date")
    
    or,what also should work:
    ITEMLEDGERENTRY.SETRANGE("Posting Date",0D,JOBJNLLINE."Posting Date")
    
Sign In or Register to comment.