在日期范围内查找记录 [英] Finding records within date range

查看:69
本文介绍了在日期范围内查找记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,

我有一个DateTime列,其中显然包含日期和时间.

我需要返回昨天上午9点到今天上午8.59点之间具有DateTime的所有记录.

有人可以帮忙吗?

在此先感谢您.

Hi there

I have a DateTime column which obviously contains the date and time.

I need to return all of the records which have a DateTime between 9am yesterday and 8.59am today.

Could anyone lend a hand?

Thanks in advance.

推荐答案

在这里您有一些相似之处:

http://bytes.com/topic/sql-server/answers/879183-select-between-17-00-yesterday-17-00-today [
Here you have something alike:

http://bytes.com/topic/sql-server/answers/879183-select-between-17-00-yesterday-17-00-today[^]

Good luck!


我建​​议您购买一本基本的初学者SQL书籍并阅读.当人们问的是程序员,自己的书,知道如何使用Google并提出涉及寻求帮助的问题时,这些论坛会更好地工作,而不是帮助人们为他们做的工作.
I suggest buying a basic beginner SQL book and reading it. These forums work better when the people asking are programmers, own books, know how to use google, and ask questions that involve asking for help with code they wrote, not help with people doing their work for them.


感谢克里斯蒂安的有用答复.实际上,在来这里之前,我确实使用过Google,并尝试自己编写SQL脚本.

我从来没有要求任何人为我做我的工作(因此-伸出援助之手).我只是在寻求建议.

大卫
Thanks for that useful reply Christian. I did in fact use Google before coming here and attempted to write the SQL script myself.

I never asked for anyone to do my work for me (hence - Lend a hand). I was merely looking for advice.

David


这篇关于在日期范围内查找记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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