怎样把自己定义的变量作为数据库查询的条件?
DIM searchdate as DATE
我看到别的程序以下语句可以通过,而我这里就不行,不知道为什么?
str=
"select * from table1
where table1.date =# " & searchdate & " # "
如果要把自己定义的变量作为查询条件以上语法正确吗?还是用其它的办法?
问题点数:10、回复次数:2Top
1 楼a97191(等待)回复于 2006-03-17 14:23:33 得分 5
数据库不同,如果是ACCESS应该可以通过,sql server
str=
"select * from table1
where table1.date =' " & searchdate & " ' "
Top
2 楼bbhere(俺是二等小兵(baby,i'll be right here waiting for you))回复于 2006-03-17 14:27:55 得分 5
str="select * from table1 where table1.date =' " & searchdate & " ' "Top




