When i send this query on SQL Server 2005 with the Microsoft SQL Server Management Studio
SELECT dbo.MOV('Hi',10,2) + dbo.MOV('Hi2',8,2)
The query returns 400
The result of anything send to the function will return 200 except if the last two parameter where 0 the value of return will be 100 and the value type of return from the function its Decimal(12,2)
the problem, comes when I do the query on Delphi
Query.SQL.Add('SELECT dbo.MOV(''Hi'',10,2) + dbo.MOV(''Hi2'',8,2)');
Query.Open;
Query.Next;
ShowMessage(Query.Fields[0].AsString);
The Query returns 200 (on the message dialog), like if SQL Server is just taking the first Function and ignoring the second one, so what i could do get from SQL Server 2005 the right calculation in Delphi. Thanks.
Try to clear Query.SQL before Query.SQL.Add.
If you already have a query stored in SQL you will only see the result from the first one.