用like语句
名称:=名称;
规格:=规格;
开始时间:=开始时间;
..
..
adoquery.sql.add('select * from table where 名称 like '+''''+'%'+名称+'%'+''''+' and 规格 like '+''''+'%'+规格+'%'+''''....
就可以了
名称:=名称;
规格:=规格;
开始时间:=开始时间;
..
..
adoquery.sql.add('select * from table where 名称 like '+''''+'%'+名称+'%'+''''+' and 规格 like '+''''+'%'+规格+'%'+''''....
就可以了
解决方案 »
- 取WebBrowser1.Document内容报错
- adoQuery简单又奇怪的问题!高手来,小虾也来,你们应该也碰到过吧!!!
- 毕业1.5年,上班1.5年,写程序1.5年,明年是本命年也是我女朋友的本命年,所以不愿意四处乱窜了
- 欢迎访问 Grid++Report 的网站:www.GridppReport.com。一个可以丢开显示网格(各种Grid)做出整个报表系统的构件,非常适合制作动态报表,
- 上次莫名其妙的因为信誉分最低得了70.故这次悬红200分揖拿信誉份最高者!请信誉分高者来自首!
- DELPHI数据的分配
- 主菜单设置快捷键,F1,F2,F3都可以设置,F4开始设了却没有反应???
- 请问:怎样使 memo或rich edit 在lines.add后能focus 在最后一行呢?
- 女人不知道自己想要什么.
- 關於TClientDataset 的問題!
- 我清醒了,Nicrosoft兄请进来取分,十分感谢
- 如何将窗口弄到前台,为什么都不好使,请高手指教。
问题是库存数只能是一个点。
你是要当前的库存数(20010920),还是20000910,还是20010910。
知道了这个,就可以写了。
要用到SELECT的嵌套。
select c.goodscode,e.goodsname,c.amount
from workthingscode e,
(select goodscode,sum(amount) amount
from
(select a.goodscode,a.amount,a.indate dd
from workthingsin a
union
select b.goodscode,-b.amount,b.outdate dd
from workthingsout b
order by goodscode,dd)
group by goodscode) c
where c.goodscode=e.goodscode
我可以帮你的。
[email protected]
查出的库存数是当前20010920的库存数。
name := '%';
if date1 = '' then
date1 :='1900-01-01';
if date2 = '' then
date2 :='2099-12-31';
strSQL := 'select inv.name,inv.qty,in.count,out.count from in,out,inv where inv.name like '''+name +''' and' (out.date between '+datetostr(date1) + ' and'
+ datetostr(date2) +') +'and (in.date between '+datetostr(date1) + ' and'
+ datetostr(date2) +') where in.name = out.name and in.name = inv.name and out.name = inv.name';
if con1 then
strSQL := strSQL + str_con1;
if con2 then
strSQL := strSQL + str_con2;
最后加上 and 1=1
from (mc,sum(chukjs) csum from chuk where rq >= :rq1 and rq <= :rq2 group by mc) temp1,
(mc,sum(rukjs) rsum from ruk where rq >= :rq1 and rq <= :rp2 group by mc) temp2where temp1.mc = :mc
and temp2.mc = temp1.mc日期格式没有定义,
库存数没有求
名称、规格缩小范围,或不选查询全部 好像要写三个Sql