Read empty Date from NAV through SQL

Y_1716Y_1716 Member Posts: 11
Hi,

I am trying to look for a record in NAV through SQL .. primary key consists of 4 fields, one of which is a date. What value should I pass through SQL to be able to search for a record with the date field empty? I have tried empty string, 0D, January 1, 1753, 00:00:00.000 (the earliest permitted DateTime).

Thanks, in advance!
Y_1716

Answers

  • DuikmeesterDuikmeester Member Posts: 307
    WHERE [Date] = '1753-01-01 00:00:00.000' should work just fine.
  • krikikriki Member, Moderator Posts: 9,112
    Better is:
    WHERE [Date] = '1753-01-01T00:00:00.000'

    With a T between date and time. It means that the format is independent of regional settings.
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • RockWithNAVRockWithNAV Member Posts: 1,139
    Make a date blank in NAV for any particular record and then fire its query in SQL, You will find the same value as mentioned by Kriki and Dukemaster. This Data 1753-01-01 00:00:00.000' behaves as a blank date for SQL.
Sign In or Register to comment.