H
holmes
Unregistered / Unconfirmed
GUEST, unregistred user!
我是delphi菜鸟(注:我用的是delphi 5),只知道一点皮毛上的皮毛,现在有个问题求各位高手解决:
在dbgrid中增加一列,但是这一列的结果是通过sql语句得出来的。具体的sql语句如下:
select m.*,calje=jeForm*Br,todaymoney=(Case Kind When '1' Then isnull(jeform,0) Else isnull(jeform,0)-isnull(jeusepreaccept,0) End)*br,
p.Name as CustomerName,jsrName=s.Name,
kmName= k.Name, jsfsName= j.Name,DerartName= d.Name,
KindName=(Case Kind When '0' Then '应收款' Else '预收款' End),
StateHin=(Case IsNull(EnterMan,'') When '' Then '未入帐' else '入帐' End)
from AcceptMaster m Left Join Personnel s On jsr= s.Code
left Join kmCode k On m.km=k.Code
left Join jsfs j On m.jsfs= j.Code
left Join Department d On m.Department=d.Code
left Join Customers p On m.Customer= p.Code
where (IsNull(Customer,'') Like :Customer
or IsNull(p.Name,'') like :Customer)
and Date>=:sd and Date<=:ed
and (Flag In ('0','2') and :fs1 = 1 or Flag='1' and :fs2 = 1)
and (Kind='0' and :ks1 = 1 or Kind='1' and :ks2 = 1)
order by m.sNo
这些语句我都不太懂是什么意思,请高手随便解释一下,现在我要添加的一列我已经通过sql语句查出来了,但是我不知道如何把它加到上面的语句里去。语句如下:
select sum(je-isnull(costprice*num,0)*br) as dprofit
from sellmaster , selldetail
where sellmaster.sno=selldetail.sno
如何能让这一列在dbgrid中显示出来??在线等,谢谢!!
在dbgrid中增加一列,但是这一列的结果是通过sql语句得出来的。具体的sql语句如下:
select m.*,calje=jeForm*Br,todaymoney=(Case Kind When '1' Then isnull(jeform,0) Else isnull(jeform,0)-isnull(jeusepreaccept,0) End)*br,
p.Name as CustomerName,jsrName=s.Name,
kmName= k.Name, jsfsName= j.Name,DerartName= d.Name,
KindName=(Case Kind When '0' Then '应收款' Else '预收款' End),
StateHin=(Case IsNull(EnterMan,'') When '' Then '未入帐' else '入帐' End)
from AcceptMaster m Left Join Personnel s On jsr= s.Code
left Join kmCode k On m.km=k.Code
left Join jsfs j On m.jsfs= j.Code
left Join Department d On m.Department=d.Code
left Join Customers p On m.Customer= p.Code
where (IsNull(Customer,'') Like :Customer
or IsNull(p.Name,'') like :Customer)
and Date>=:sd and Date<=:ed
and (Flag In ('0','2') and :fs1 = 1 or Flag='1' and :fs2 = 1)
and (Kind='0' and :ks1 = 1 or Kind='1' and :ks2 = 1)
order by m.sNo
这些语句我都不太懂是什么意思,请高手随便解释一下,现在我要添加的一列我已经通过sql语句查出来了,但是我不知道如何把它加到上面的语句里去。语句如下:
select sum(je-isnull(costprice*num,0)*br) as dprofit
from sellmaster , selldetail
where sellmaster.sno=selldetail.sno
如何能让这一列在dbgrid中显示出来??在线等,谢谢!!