请问 怎么select 某年某月的 相关信息?应该怎么写?我的date列是 2007-01-02 上午 10:00:00 这种形式的
select id,content from art where date???????
我只想 select 精确到月份
select id,content from art where date='2007-01' 这样不行把? 应该怎么写呢?
select id,content from art where date???????
我只想 select 精确到月份
select id,content from art where date='2007-01' 这样不行把? 应该怎么写呢?
还有dateg列是什么类型的?
Dim str3 As String = " select * from art where convert(char(7),date,120)='" + yearstr + "-" + monthstr + "'"
这样写的
说 convert 函数未定义
还会出错吗?
本人不懂VB
select * from table where year(date)+month(date)='20071'
-------------------------------------------------
比如date是'2007-04-02',你的结果会是2011,需要转为字符型再连接
select * from [table] where rtrim(year(date))+rtrim(month(date))='20071'
neo_aksa() ( ) 信誉:100 Blog 2007-04-02 14:20:19 得分: 0
select * from table where convert(varchar(4),date)+convert(varchar(2),date)='20073'
---------------------------------------------------
也不对 hxd001_810(寒冬) ( ) 信誉:100 Blog 2007-04-02 14:22:05 得分: 0
select id,content from art where date like '2007-01%'
--------------------------------------------------------------
对日期型数据like不对
select id,content from art where convert(char(10),date,120) like '2007-01%'