在 SQL 中存储一天中的时间 [英] Store time of the day in SQL

查看:29
本文介绍了在 SQL 中存储一天中的时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您将如何在 SQL 中存储时间或时间范围?它不会是日期时间,因为它只是让我们说下午 4:30(不是,1 月 3 日下午 4:30).这些将是每周或每天的会议.我需要的查询类型当然是用于显示的,但稍后还会包括复杂的查询,例如避免日程冲突.我现在宁愿选择最好的数据类型.

How would you store a time or time range in SQL? It won't be a datetime because it will just be let's say 4:30PM (not, January 3rd, 4:30pm). Those would be weekly, or daily meetings. The type of queries that I need are of course be for display, but also later will include complex queries such as avoiding conflicts in schedule. I'd rather pick the best datatype for that now.

我使用的是 MS SQL Server Express 2005.

I'm using MS SQL Server Express 2005.

谢谢!

内森

推荐答案

我个人认为这是升级到具有单独时间数据类型的 2008 的原因.

Personally I would find this a reason to upgrade to 2008 which has a separate time datatype.

这篇关于在 SQL 中存储一天中的时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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