VB 里...谁帮我看看这一句语句错在哪里了?
问题描述:
VB 里...谁帮我看看这一句语句错在哪里了?
sql = "select [明细序号],[存款金额] from [cardinlist] where [账户号码] =" & Trim(combcard.Text) & " and [日期] between #" + fird + "# and #" + secd + "#"
总是不对..
答
字符串类型要加单引号(如同日期类型值两边要用#号)
例如:[账户号码] ='12234'and [日期]
所以你的例子应该:
[账户号码] ='" & Trim(combcard.Text) & "' and
等号右边1个,and前有个空格,空格前加1个但引号