Delphi: Delphi and Microsoft SQL Server 2005 bad calculations from function values -


when send query on sql server 2005 microsoft sql server management studio

select dbo.mov('hi',10,2) + dbo.mov('hi2',8,2) 

the query returns 400

the result of send function return 200 except if last 2 parameter 0 value of return 100 , value type of return function decimal(12,2)

the problem, comes when 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 message dialog), if sql server taking first function , ignoring second one, sql server 2005 right calculation in delphi. thanks.

try clear query.sql before query.sql.add.

query.sql.clear query.sql.add('select dbo.mov(''hi'',10,2) + dbo.mov(''hi2'',8,2)'); 

if have query stored in sql see result first one.


Comments

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

android - layout with fragment and framelayout replaced by another fragment and framelayout -