Firebird 中的简单选择失败
我想要做的就是选择两个日期之间的记录(在 YYYY-MM-DD HH:II:SS 和 YYYY-MM-DD HH:II:SS 之间)。包含日期和时间的字段采用 TIMESTAMP 格式。我什至无法按日期选择记录。
查询
SELECT *
FROM INVOICE
WHERE CAST(INVOICE.WHENINVOICED AS DATE) = CAST('2010-10-15' AS DATE)
ORDER BY INVOICE.WHENINVOICED ASC
没有返回任何记录,也没有错误。此日期存在记录。
All I want to do is select records between two dates to second precision (between YYYY-MM-DD HH:II:SS and YYYY-MM-DD HH:II:SS). The field which contains date AND time is in TIMESTAMP format. I can't even select records by date.
The query
SELECT *
FROM INVOICE
WHERE CAST(INVOICE.WHENINVOICED AS DATE) = CAST('2010-10-15' AS DATE)
ORDER BY INVOICE.WHENINVOICED ASC
returns no records and no error. Records exist with this date.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您不需要强制类型转换。 WhenInvoiced 当然是日期类型列?
You do not need to cast types. WhenInvoiced is a date type column ofcourse?