A
autojet
Unregistered / Unconfirmed
GUEST, unregistred user!
在做三層程序中,在中間層用一個ClientDataSet連一個Dataprovider再連一個AdoQuery,
從數據庫(SQL Server 2000)中取得數據,然后通過將中間層的ClientDataSet.Data賦值給
一個TOleVariant型變量,讓該變量將結果集傳回客戶端,其它SQL語句一節正常,只有下面一
句,結果集中浮點數據字段全為2020,請教各位高手大俠指點!
SQL語句如下:
Select D.DeptName, J.JobName,Count(P.Empcode)As empAmount,
Sum(p.Ghour) As Ghour,Sum(P.OHour)AS OHour,Sum(p.SunHour)As SunHour,
Sum(P.HolidayHour)AS HolidayHour,Sum(P.HHour)AS HHour,
Sum(P.BruiseHour)As BruiseHour,Sum(P.Pay1)As Pay1,Sum(P.Pay2)As Pay2,
Sum(P.Pay3)As Pay3,Sum(P.pay4)As Pay4,Sum(P.Pay5)As Pay5,Sum(P.Pay6)As Pay6,
Sum(P.Pay7)As Pay7,Sum(P.Pay8)As Pay8,Sum(P.pay9)As Pay9,Sum(P.Pay10)As Pay10,
Sum(Pay11)As Pay11,Sum(P.Pay12)As Pay12,Sum(P.Pay13)As Pay13,Sum(P.Pay14)As Pay14,
Sum(P.Pay15)As Pay15,Sum(P.Pay16)As Pay16,Sum(P.Pay17)As Pay17,Sum(P.Pay18)As Pay18,
Sum(P.Pay19)As Pay19,Sum(P.totalPay)As TotalPay
From Pr_MonthReport P
Join Bas_Dept D on P.DeptCode=D.DeptCode
Join Bas_Employee B on P.EmpCode=B.EmpCode
join Bas_Jober J on B.Jobcode=J.JobCode
Where [Month]='2002/11' group By DeptName,JobName
本語句在查詢分析器中可能正常執行,并返回正確結果,在三層中執行時能返回結果,
但結果中的數據(浮點型求和數據)不正確,全為2020
從數據庫(SQL Server 2000)中取得數據,然后通過將中間層的ClientDataSet.Data賦值給
一個TOleVariant型變量,讓該變量將結果集傳回客戶端,其它SQL語句一節正常,只有下面一
句,結果集中浮點數據字段全為2020,請教各位高手大俠指點!
SQL語句如下:
Select D.DeptName, J.JobName,Count(P.Empcode)As empAmount,
Sum(p.Ghour) As Ghour,Sum(P.OHour)AS OHour,Sum(p.SunHour)As SunHour,
Sum(P.HolidayHour)AS HolidayHour,Sum(P.HHour)AS HHour,
Sum(P.BruiseHour)As BruiseHour,Sum(P.Pay1)As Pay1,Sum(P.Pay2)As Pay2,
Sum(P.Pay3)As Pay3,Sum(P.pay4)As Pay4,Sum(P.Pay5)As Pay5,Sum(P.Pay6)As Pay6,
Sum(P.Pay7)As Pay7,Sum(P.Pay8)As Pay8,Sum(P.pay9)As Pay9,Sum(P.Pay10)As Pay10,
Sum(Pay11)As Pay11,Sum(P.Pay12)As Pay12,Sum(P.Pay13)As Pay13,Sum(P.Pay14)As Pay14,
Sum(P.Pay15)As Pay15,Sum(P.Pay16)As Pay16,Sum(P.Pay17)As Pay17,Sum(P.Pay18)As Pay18,
Sum(P.Pay19)As Pay19,Sum(P.totalPay)As TotalPay
From Pr_MonthReport P
Join Bas_Dept D on P.DeptCode=D.DeptCode
Join Bas_Employee B on P.EmpCode=B.EmpCode
join Bas_Jober J on B.Jobcode=J.JobCode
Where [Month]='2002/11' group By DeptName,JobName
本語句在查詢分析器中可能正常執行,并返回正確結果,在三層中執行時能返回結果,
但結果中的數據(浮點型求和數據)不正確,全為2020