选择日期列,然后再指定特定列 [英] select date column greater then specific

查看:80
本文介绍了选择日期列,然后再指定特定列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在where子句中具有以下条件:

I have the following criteria in where clause:

cat_product.datetime > '2012-09-18 11:24:54'

结果:

18.09.2012 11:24:54
18.09.2012 11:34:51
18.09.2012 12:07:12

结果中包含18.09.2012 11:24:54的问题.为什么?在条件中,写>运算符而不是>=.

The problem in that the result contain 18.09.2012 11:24:54. Why? In the criteria write > operator not >=.

推荐答案

问题(以毫秒为单位). 需要转换为没有毫秒数的格式. 如:

Problem with milliseconds. Needs to convert to a format which do not have miliseconds. Such as :

SELECT CONVERT(VARCHAR,GETDATE(),120)

对您来说,应该是这样的:

For you, it should be something like:

CONVERT(VARCHAR, cat_product.datetime,120) > '2012-09-18 11:24:54'

这篇关于选择日期列,然后再指定特定列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆