'TODAY' is not a valid date

amadman114amadman114 Member Posts: 36
I am trying to filter the Purchase Header table, using the following code:
GrecPurchaseHeader.RESET;
GrecPurchaseHeader.SETFILTER("Expected Receipt Date",'<TODAY');
CurrForm.UPDATE(FALSE);
Placed in the OnOpenForm trigger.

I get the error
'TODAY' is not a valid date.

I'm surely missing something obvious, but I can't find anything on it. I could sure use some help!
Thanks,
Dan

Comments

  • vaprogvaprog Member Posts: 1,141
    amadman114 wrote:
    I'm surely missing something obvious
    Yes, you're right.

    You intend to use today's date. TODAY is a function that returns today's date. 'TODAY' (note the single quotes) on he other hand is a string consisting of the characters 'T', 'O', ....
    So use
    GrecPurchaseHeader.SETFILTER("Expected Receipt Date",'<%1',TODAY);
    
Sign In or Register to comment.