anchor.diff:  begin
     if (FDataType = ptDate) or (FDataType = ptDateTime) then
     begin
  -    Result := ValueAsDouble;
  +    if VarIsNull(FValue) or VarIsEmpty(FValue) then
  +      Result := 0
  +    else
  +      Result := VarToDateTime(FValue);
     end
     else
     begin
  
positive.code: function TmQueryParameter.GetParameterDataType: TmParameterDataType;
  begin
    Result := FDataType;
  end;
  
  function TmQueryParameter.ValueAsDouble: Double;
  begin
    if (FValue = Null) then
      Result := 0
    else
      Result := FValue;
  end;
  
  function TmQueryParameter.ValueAsBoolean: Boolean;
  
negative.code: begin
    if (FDataType = ptFloat) then
    begin
      if VarIsNull(FValue) or VarIsEmpty(FValue) then
        Result := 0
      else
        if VarIsFMTBcd(FValue) then
          Result := BCDToDouble(VarToBCD(FValue))
        else
          Result := FValue;
    end
    else
    begin
  