Problems with Result query lazarus / 16-Databases ---------------------------------------------------------------------- berghem · 2005-11-26 17:37 Hi, I have this query, when Lazarus executes the query I have the error in the first row, because the result is not Null if  myQuery['Field'] <> Null then begin       Result   := Integer(MyQuery['Field']) + 1; end else begin          Result   := 1; end; Why? Sorry for my english ---------------------------------------------------------------------- Marc · 2005-11-28 13:59 Maybe you can skip the (ugly) variant casting and try the following: Code: [Select]Field := myQuery.FieldByName('Field'); if Field.IsNull then Result := 1 else Result := Field.AsInteger + 1; ---------------------------------------------------------------------- Anonymous · 2005-11-28 16:36 Thank you very much Marc, now ot's all Ok. W Lazarus!!!!