MS SQL Date Only Without Time

后端 未结 12 1565
有刺的猬
有刺的猬 2020-12-13 02:02

Question

Hello All,

I\'ve had some confusion for quite some time with essentially flooring a DateTime SQL type using T-SQL. Essentially, I want to take a

12条回答
  •  借酒劲吻你
    2020-12-13 02:28

    Yes, T-SQL can feel extremely primitive at times, and it is things like these that often times push me to doing a lot of my logic in my language of choice (such as C#).

    However, when you absolutely need to do some of these things in SQL for performance reasons, then your best bet is to create functions to house these "algorithms."

    Take a look at this article. He offers up quite a few handy SQL functions along these lines that I think will help you.

    http://weblogs.sqlteam.com/jeffs/archive/2007/01/02/56079.aspx

提交回复
热议问题