我好多菜鸟问题刚解决 excel 格式问题又出现 access sql 查询问题
请高手介绍书啊或解决序号在数据库 是 长整型, ixuhao 是个 long 变量
SQL = "select * from 称重记录表 where 序号= ' "&ixuhao&" ' "说至少一个参数没 赋值 这个SQL语句该怎么写啊?????最好介绍书啊!!!!比如还有 日期类型sql = "select * from 称重记录表 where 序号= ' "&ixuhao&" '
and 时间 between ' "&dateb1&" ' and ' "&dateb2&" ' "其中 dateb1, dateb2 是date变量,数据库都通不过只有string 变量能通过?
请高手介绍书啊或解决序号在数据库 是 长整型, ixuhao 是个 long 变量
SQL = "select * from 称重记录表 where 序号= ' "&ixuhao&" ' "说至少一个参数没 赋值 这个SQL语句该怎么写啊?????最好介绍书啊!!!!比如还有 日期类型sql = "select * from 称重记录表 where 序号= ' "&ixuhao&" '
and 时间 between ' "&dateb1&" ' and ' "&dateb2&" ' "其中 dateb1, dateb2 是date变量,数据库都通不过只有string 变量能通过?
改為:
SQL = "select * from 称重记录表 where 序号= "& ixuhao sql = "select * from 称重记录表 where 序号= ' "&ixuhao&" '
and 时间 between ' "&dateb1&" ' and ' "&dateb2&" ' "改為: sql = "select * from 称重记录表 where 序号= "& ixuhao _
and 时间 between # "& dateb1 &"# and # " & dateb2 &"#"就可以了.
sql=sql & ixuhao
试试像这样,应该就行了
SQL = "select * from 称重记录表 where 序号=" & ixuhao
时间变量这样写:
对于access,应该这样:
SQL = "select * from 称重记录表 where 时间=#" & shijian & "#"
对于sqlserver,应该这样:
SQL = "select * from 称重记录表 where 时间='" & shijian & "'"
sql="select * from 称重量记录表 where 序号= '" & " ixuhao " & "'"
时间变量这样写:
对于access,应该这样:
SQL = "select * from 称重记录表 where 时间=#" & shijian & "#"
对于sqlserver,应该这样:
SQL = "select * from 称重记录表 where 时间='" & shijian & "'"
时间类型加两边#,字符型两边加‘