Office中国论坛/Access中国论坛

标题: access vba 求医, 这段有何问题(zzz) [打印本页]

作者: ZZBZZBZZZB    时间: 2009-6-8 20:15
标题: access vba 求医, 这段有何问题(zzz)

mysqln = "select sum(
借方金额) as a1,sum(贷方金额) as a2
from
清单 " & "where month(日期)=" & Month(Now())







mysqln = "select sum(
借方金额) as a1,sum(贷方金额) as a2
from
清单 " & "where month(日期)=" & Month(Now()) And 凭证号 = A





第一段的没问题,第二段编译也没发现问题,可就是查询不出来什么东西,应是能查出的.向各位高手请教
作者: Henry D. Sy    时间: 2009-6-8 20:26
mysqln = "select sum(借方金额) as a1,sum(贷方金额) as a2
from 清单  where month(日期)=" & Month(Now()) & "  And 凭证号 ='A'"
作者: ZZBZZBZZZB    时间: 2009-6-8 20:37
mysqln = "select sum(借方金额) as a1,sum(贷方金额) as a2" from 清单  where month(日期)=" & Month(Now()) & " And 凭证号 ='A'"

提示 缺少语句结束呀
作者: ZZBZZBZZZB    时间: 2009-6-8 20:38
忘了说明,A是长整形变量
作者: Henry D. Sy    时间: 2009-6-8 20:45
mysqln = "select sum(借方金额) as a1,sum(贷方金额) as a2" from 清单  where month(日期)=" & Month(Now()) & " And 凭证号 =" & A
作者: ZZBZZBZZZB    时间: 2009-6-8 21:50
就是这个了,多谢!




欢迎光临 Office中国论坛/Access中国论坛 (http://www.office-cn.net/) Powered by Discuz! X3.3