Access:
Select * from tablename where datefieldname <#2002/04/16#SQL Server:
Select * from tablename where datefieldname <'2002/04/16'
Select * from tablename where datefieldname <#2002/04/16#SQL Server:
Select * from tablename where datefieldname <'2002/04/16'
解决方案 »
- SQL触发器问题?
- 多张表连接时,其中每个连接之间什么关系?
- 简单问题!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
- 请教一条有关日期的SQL语句.解决立刻结帐,在线等
- 对象 'DF__SCZjdPro__dss__51C5D689' 依赖于 列 'dss'。 51C5D689这个是什么?
- SQL求闭包疑问。
- 问一个关于去掉含null值行的用法
- 简单的问题---注释语句怎么写?12点以前结帖
- sys.systable是什么表,为什么找不到?
- 在DB2中把一个数据库中一些表迁移到另一个数据库中最好的方法怎样做?(除了EXPORT/IMPORT)
- SQl Server 安装问题
- 存储过程的困惑---如何输入变量字段
我也碰到了如此的问题:select * from news where news_date between '2002/04/16'and '2002/04/17'
其中 news_date是日期型变量,但不行
因为在数据库中news_date 显示到了秒。可我在程序中的日期值只能到天
。如何解决呢!
只显示4月16日的数据,如果要显示17日的数据,请用:
select * from news where news_date between '2002/04/16'and '2002/04/18'
select * from t1 where datetime1 between '2002/04/16'and '2002/04/17' id datetime1
----------- ------------------------------------------------------
1 2002-04-15 23:59:59.000
2 2002-04-16 00:00:00.000
3 2002-04-16 00:00:01.000
4 2002-04-16 23:59:59.000
5 2002-04-17 00:00:00.000
6 2002-04-17 00:00:01.000(所影响的行数为 6 行)id datetime1
----------- ------------------------------------------------------
2 2002-04-16 00:00:00.000
3 2002-04-16 00:00:01.000
4 2002-04-16 23:59:59.000
5 2002-04-17 00:00:00.000(所影响的行数为 4 行)