九叶儿

关注具体问题的解决

2011年7月4日 #

sql 日期获取

摘要: DATENAME 返回代表指定日期的指定日期部分的字符串。 语法 DATENAME ( datepart , date ) 参数 datepart 是指定应返回的日期部分的参数。下表列出了 Microsoft® SQL Server™ 识别的日期部分和缩写。 日期部分 缩写 year yy, yyyy quarter qq, q month mm, m dayofyear dy... 阅读全文

posted @ 2011-07-04 17:20 九叶儿 阅读(371) 评论(0) 推荐(0) 编辑

c#获取当前时间,不带日期

摘要: string time = DateTime.Now.ToString(); string nowtime = time.Substring(9, 5); Console.WriteLine(nowtime); Console.ReadLine(); 阅读全文

posted @ 2011-07-04 16:52 九叶儿 阅读(1114) 评论(2) 推荐(0) 编辑

set与select赋值问题,同时涉及时间比较

摘要: set只能为一个结果赋值 use myexample go declare @a varchar(50) set @a=(select top 1 id from users) if(@a<=convert(varchar(100),getdate(),24)) print @a else print convert(varchar(100),getdate(),24) go 而select能够同... 阅读全文

posted @ 2011-07-04 16:49 九叶儿 阅读(277) 评论(0) 推荐(0) 编辑

导航