Options

Date comparison in an IF/THEN

CannikinCannikin Member Posts: 72
Normally I'd say this is the world's biggest newbie question, but since I can't find it in the online help, maybe it's not so bad. What's the format for comparing a date in an IF/THEN statement? Every combination I try of quotes, double quotes, etc. has been wrong. I really want to test if a date field is blank:

IF SalesInvHeader.RequiredDeliveryDate = '' THEN
...

But of course that says I can't compare Date and Text. Is the date truly blank or does it default to 1/1/1900?

Thanks for any help!

Rob

Comments

  • Options
    Luc_VanDyckLuc_VanDyck Member, Moderator, Administrator Posts: 3,633
    Use 0D to test for a blank date:

    IF SalesInvHeader.RequiredDeliveryDate = 0D THEN
    No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)
  • Options
    CannikinCannikin Member Posts: 72
    Worked! Thanks dude!
Sign In or Register to comment.