procedure TForm1.Button1Click(Sender: TObject);
var
i:integer;
begin
with adoquery1 do
begin
Close;
SQL.Clear;
SQL.Text := 'select riqi,suxue from cheji ' +
'where riqi = ''' + FormatDateTime('yyyy-mm-dd',DateTimePicker1.DateTime) +''''
and ????????;
Open;
end;
end;我要把DateTimePicker1选中的时间在dbgrid中显示出来,并且把数学这个字段下的所有数据求和,
该如何实现,请帮助。
var
i:integer;
begin
with adoquery1 do
begin
Close;
SQL.Clear;
SQL.Text := 'select riqi,suxue from cheji ' +
'where riqi = ''' + FormatDateTime('yyyy-mm-dd',DateTimePicker1.DateTime) +''''
and ????????;
Open;
end;
end;我要把DateTimePicker1选中的时间在dbgrid中显示出来,并且把数学这个字段下的所有数据求和,
该如何实现,请帮助。
解决方案 »
- DbEdit1.Text 为什么取不出来值????????
- 菜鸟问题:找不到TSQLClientDateSet类
- 能不有在鼠标移动到DBGrid上时取到鼠标下的那一行数据?
- 这样行不行?
- 为什么报表预览的时候报表的横线有粗有细,怎样才能让它们粗细一致呢?
- ★★★各位大侠急救 关于word中生成文本框★★★
- 如何控制EDIT里只能输入数字、退格键、DEL键,一时想不起来了:(
- (送高分!)怎样写与分辨率无关的windows程序?(送高分!)
- 请问:Code Completion关闭了,怎样打开啊?
- 如何用控件Query不能实现查询
- 请问如何把inputbox中的ok,canel改为中文确定和取消
- 使用idtcpserver 客户机断电或按复位键重启问题
begin
SQL.Text := 'select '+#39+FormatDateTime('yyyy-mm-dd',DateTimePicker1.DateTime) +#39+' as choseriqi,sum(suxue) as sumsuxue,riqi,suxue from cheji ' +
' where riqi = ''' + FormatDateTime('yyyy-mm-dd',DateTimePicker1.DateTime) +''''
and ????????
group by riqi,suxue';
Open;
end;
'where riqi = ''' + FormatDateTime('yyyy-mm-dd',DateTimePicker1.DateTime) +''''
and ????????;
=======不太明白你的意思,可能理解有误=========>
SQL.add('select riqi,sum(suxue) as 新栏位名 from cheji');
SQL.add('where riqi = FormatDateTime('yyyy-mm-dd',DateTimePicker1.DateTime)');是这个意思吗,呵呵