vb程序,sql的a包含B是怎么写的
“车辆排班”表有个“日期”的字段,是string格式,没用date格式,内容如“2009-12-31 12:48:01”,现在要查询日期字段里面包含“2009-12-31”的内容,不要后面部分。
select * from 车辆排班 where 日期…………
select * from 车辆排班 where left(日期,10)='2009-12-31'
select * from 车辆排班 where charindex('2009-12-31',日期)>0
忘了说,是access数据库哦,好像不支持charindex
用like模糊查询可能更好
SQL code:
Select * from 车辆排班 Where 日期 Like '2009-12-31%'
access 支持 mid() ,instr() ,一个道理.
Dim a As String
a = CStr(MonthView1)
Adodc4.RecordSource = "select * from 车辆排班 where left(日期,10)='a'“
Adodc4.Refresh
这个变量a在sql里面要加什么符号??
用format 试试
SELECT *
from 车辆排班 where format(字段1,'yyyy-mm-dd') = '2009-12-31';
相关问答:
初学,大胆提问,请高手不吝赐教
1、滚动条点击与绘图板(屏幕,Piceure1)的移动问题已经解决。
Picture1.Top = -VScroll1.Value + bcW '垂直移动
Picture1.Left = -HScroll1.Value + bcW ' ......
<table style="width: 1000px"><tr>
<td style="height: 38px; width: 35px;">
姓名</td>
......
从数据库中查询一张表的数据
select 部门,姓名 from tb
如何才能生成下面的xml格式
XML code:
<folder state="unchecked" label="全部">
<folder state="unchecked&qu ......
刚接触vb6.0,有些摸不到的感觉,敬请各位大虾给点建议!!!
不会吧,推荐学习.NET。顺便推荐实用代码网站http://bingning.net/free/source/index.html。
如果没基础 就用易语言吧 中文编程呢 代码都是中文 ......
我们C#做一个窗体 往数据库里插入数据
SqlConnection cn = new SqlConnection("Data Source=20090713-1752\\SQLEXPRESS;Initial Catalog=goods;Integrated Security=True");
......