如何判断带日期的时间和不带日期的时间相同 datediff(day,ol_time,getdate())=0其中ol_time是字段getdate()是当前时间 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 方法很土,但可以解决你这个问题:2000-1-1 = cast(Year(2000-1-1 12:00:00) as varchar(4)) + '-' + cast(Month(2000-1-1 12:00:00) as varchar(4)) + '-' + cast(Day(2000-1-1 12:00:00) as varchar(4)) select case when (day('2000-1-1') = day('2000-1-1 12:00:00')) then 'yes' else 'no' end declare @n1 smalldatetime,@n2 smalldatetimeselect @n1='2000-1-1',@n2='2000-1-1 12:00:00'if datediff(dd,@n1,@n2)=0 print '相同'else print '不相同' if convert(char(10),getdate(),120)=‘2000-1-1’ then print '相同'elseprint'不相同' 怎么调用函数 导求一份开发文档,有案例说明一下就可以了 SQL2005安装前和安装后可不可以把数据文件的路径设置在其它盘符如D:\下? 这个存储过程问题在哪里? 求救!三个表相关查询! 在VB里调用带exec的存储过程问题 大家快来帮我设计数据库,谢谢,急用 数据导出,高分赠送!!!——急~~~ 强烈请求firetoucher(风焱) ,xiufengy(石破天),txlicenhe(不做技术高手) ( 等各位大哥解决一下我的问题 Sql Server多库中相关表的约束问题 怎样连接远程的SQL2000服务器?? 如果一个数据库里有冗余的数据(除了编号不一样),那怎样只显示其中的一条数据?
2000-1-1 = cast(Year(2000-1-1 12:00:00) as varchar(4)) + '-' + cast(Month(2000-1-1 12:00:00) as varchar(4)) + '-' + cast(Day(2000-1-1 12:00:00) as varchar(4))
select @n1='2000-1-1',@n2='2000-1-1 12:00:00'
if datediff(dd,@n1,@n2)=0
print '相同'
else
print '不相同'
print '相同'
else
print'不相同'