求sql统计语句

蜗蜗奶糖 2006-09-04 09:57:32
用asp怎么实现月统计与年统计?比如统计这个月的汇款,或当年的汇款!汇款时间和数额己经存在数据库中了!
...全文
287 6 打赏 收藏 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
tmxsl1214 2006-09-16
  • 打赏
  • 举报
回复
楼上两位有没有搞错,表名都没有。

select sum(金额) from table where time between begintime and endtime;

或者

select sum(金额) from table where time>=begintime and time<=endtime;
iasky 2006-09-16
  • 打赏
  • 举报
回复
select sum(cash) where time between a and b

a 到 b 时间内的

主要就是构造sql语句了
rockywu 2006-09-16
  • 打赏
  • 举报
回复
select sum(金额) from table group by time having month(time)=month(searchtime)
查年
select sum(金额) from table group by time having year(time)=year(searchtime)
rockywu 2006-09-16
  • 打赏
  • 举报
回复
月统计与年统计??
select sum(金额) from table where time between begintime and endtime;
或者
select sum(金额) from table where time>=begintime and time<=endtime
表示时间范围!
下面查月
select sum(金额) from table where group by time having month(time)=month(searchtime)
查年
select sum(金额) from table where group by time having year(time)=year(searchtime)
windwl 2006-09-04
  • 打赏
  • 举报
回复
select sum(金额) where shijian between time1 and time2
蜗蜗奶糖 2006-09-04
  • 打赏
  • 举报
回复
妈的,没分了,想删以前贴子,删不了了,大家快想想办法!

28,402

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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