vb+sql 查询 like% where datefield like '" & Text1.Text & "%'" 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 where datefield like #" & Cdate(Text1.Text) & "%#" where datefield >=format("03-2-27","yyyy-mm-dd 00:00:00") AND datefield<=format("03-2-27","yyyy-mm-dd 23:59:59") where Cdate('03-2-27 10:20:25')='"&text1.text&"'" to Girl1983(长发女生):你用的"#"是什么意思??? wuzhiliang(枕着雨声入眠) AND hengxin54(火星)Cdate()是什么函数啊???format()又是什么意思啊??怎么用啊小弟请教 strSql="select ... where datefield between '" & text1 & "' 00:00:00' AND '" & text1 & "' 23:59:59' " 精确的查询text="03-02-27"strSql="select ... where year(getdate())=" & Format(Text, "yyyy") & _" and month(getdate())=" & Format(Text, "mm") & _" and day(getdate())=" & Format(Text, "dd") getdate() 是我举的例子,要换成具体的日期字段名 例如text="03-02-27"就是你要查的日期,DateField是你的日期字段名。where子句分别吧对应的年月日匹配,查出的就是你要的日期的结果!strSql="select ... where year(DateField)=" & Format(Text, "yyyy") & _" and month(DateField)=" & Format(Text, "mm") & _" and day(DateField)=" & Format(Text, "dd") format :数据格式化函数,MSDN有,去看看CDate:把日期型字符串转换成日期型数据 MSDN有,去看看 求助:怎样用vb实现列网站目录和文件!??? 解决图片保存问题 ADO局域网,VPN网络,访问SQL数据库问题 问一个关于ComboBox的问题。 使用API WNetAddConnection2 的一点疑问。请进。。。 广域网的恶梦!请高手解释!!!谢谢!! 用VB能不能直接调用excel的宏呢? 如何找到控件信息? 如何设置纸张大小? 关于大数运算!!!!!!!!!!!!! 怎么把一个Winsock放入到一个类中? 如何屏蔽掉控件中的mousemove事件 急!!
你用的"#"是什么意思???
Cdate()是什么函数啊???
format()又是什么意思啊??怎么用啊
小弟请教
text="03-02-27"
strSql="select ... where year(getdate())=" & Format(Text, "yyyy") & _
" and month(getdate())=" & Format(Text, "mm") & _
" and day(getdate())=" & Format(Text, "dd")
要换成具体的日期字段名
DateField是你的日期字段名。
where子句分别吧对应的年月日匹配,
查出的就是你要的日期的结果!
strSql="select ... where year(DateField)=" & Format(Text, "yyyy") & _
" and month(DateField)=" & Format(Text, "mm") & _
" and day(DateField)=" & Format(Text, "dd")