I have a question here ... I have a field in SQL Server database of type DateTime that can be null. In Delphi, inside MemTable (or ClientDataSet ... would be the same in this case), the field was created as SQLTimeStamp Field. I want to see if this field has a date or is null, but I did not get a correct comparison without giving compile error saying that the types are different. Here is the code:
if fDm.fdmEmail.FieldByName('esr_ultimo').AsSQLTimeStamp > 0 then // Aqui dá erro na compilação
begin
// Formatar o campo...
edtUltimo.Text := SQLTimeStampToStr('dd/mm/yyyy', fDm.fdmEmail.FieldByName('esr_ultimo').AsSQLTimeStamp);
end;
I've tried "< > NULL", "< > 'NULL'", and several others ... Thanks in advance.