可以肯定一点就是用getdate()函数插入的时间为 年月日+时分秒。
问1:可以把时间改为“年月日”吗?(示例数据库Northwing的日期项就是这样)
问2:在C#下定义 DateTime time=DateTime.Now;,格式也是 年月日+时分秒 ,有没办法改为“年月日”。不用tostrig()方法,因为这样会改变time的类型,不利于查询。
问3:SQL语句 :“select * from UsersTable where CreatedDate=time ”的条件应该怎样写
(其中UsersTable为数据库中的用户表,CreatedDate为用户表中的一个域)大家可以给出例子吗??
问1:可以把时间改为“年月日”吗?(示例数据库Northwing的日期项就是这样)
问2:在C#下定义 DateTime time=DateTime.Now;,格式也是 年月日+时分秒 ,有没办法改为“年月日”。不用tostrig()方法,因为这样会改变time的类型,不利于查询。
问3:SQL语句 :“select * from UsersTable where CreatedDate=time ”的条件应该怎样写
(其中UsersTable为数据库中的用户表,CreatedDate为用户表中的一个域)大家可以给出例子吗??
这样可以
2:DateTime.Now.ToShortDateString();
3:where CreatedDatebetween '2005-3-11' and '2005-3-12'