请问如何在sql的求和传给其它控件(如text控件)

wuji 2000-06-07 12:10:00
请问如何在sql的求和传给其它控件(如text控件),还有关于用sql查询日期的代码如何写请大家帮帮忙。
...全文
71 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
halfone 2000-06-07
  • 打赏
  • 举报
回复
dim rst as recordset
set rst=db.openrecordset(" select sum(字段名) from table名 where 条件 group by 字段,字段,....")
text1.text=rst.fields(0)

日期的方法是用两个#括起来。如#1999/1/1#
applekiller 2000-06-07
  • 打赏
  • 举报
回复
select sum(需求和的字段) sumField from yourtable where ....
返回的sumField就是你需要的和。
text1.text=msrdc1.resultset!sumField

select * from yourtable where 日期 between "2000-5-1" and "2000-6-7"

1,451

社区成员

发帖
与我相关
我的任务
社区描述
VB 控件
社区管理员
  • 控件
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧