为何日期条件不起作用???

tatty_bad tatty_bad 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
最近7天
SELECT a.Id, a.outname, SUM(IIf(ISNULL(b.outMoney),0,b.outMoney)) AS Total FROM tatty_outtype AS a LEFT JOIN tatty_outlist AS b ON (b.outtype = a.id and a.tattyid=1 and datediff('d',outtime,now())<7) GROUP BY a.id, a.outname ORDER BY a.id

5-1到5-10之间
SELECT a.Id, a.outname, SUM(IIf(ISNULL(b.outMoney),0,b.outMoney)) AS Total FROM tatty_outtype AS a LEFT JOIN tatty_outlist AS b ON (b.outtype = a.id and a.tattyid=1 and outtime between #2018-05-01# and #2018-05-10#) GROUP BY a.id, a.outname ORDER BY a.id

这两条语句,在Access数据库里面查询,是起作用的。
但是放到程序里面,就没有用,查询出来的是所有的数据,这是为啥,不解。。

...全文

相关推荐

评论 2
收藏 已收藏
分享
返回顶部
tatty_bad
Access 7,731 成员 28,797 内容