Code: Select all
var CurrencyParam, CurrencyRes : Currency;
begin
CurrencyParam := 4443.3232;
with IBCQuery2 do
begin
Close;
Options.AutoPrepare := true;
SQL.Text := 'SELECT CURRENCY FROM CurrTest WHERE CURRENCY > :CURRENCY_MIN';
ParamByName('CURRENCY_MIN').Value := CurrencyParam;
Open;
First;
while not Eof do
begin
CurrencyRes := FieldByName('CURRENCY').AsCurrency;
Memo1.Lines.Add('Result ' + floatToStr(CurrencyRes));
Next;
end; // while
end;
- Use a variable of type Double or Extended.
- Assign the value with the "AsCurrency" property instead of "Value".
- Turn the Option.AutoPrepare off.
Thanks in advance.