datetime,smalldatetime都是日期加上时间的。你的两个类型都写错了。

解决方案 »

  1.   

    光要时间信息的话还是用smalldatetime比较好吧,用char的话还需要进行数据有效性检查,前者的话DBMS就做了。取数据的时候只取后面时间部分就好了。——个人意见:)
      

  2.   

    datetime 和 smalldatetime
    代表日期和一天内的时间的日期和时间数据类型。 datetime
    从 1753 年 1 月 1 日到 9999 年 12 月 31 日的日期和时间数据,精确度为百分之三秒(等于 3.33 毫秒或 0.00333 秒)。如下表所示,把值调整到 .000、.003、或 .007 秒的增量。smalldatetime
    从 1900 年 1 月 1 日到 2079 年 6 月 6 日的日期和时间数据精确到分钟。29.998 秒或更低的 smalldatetime 值向下舍入为最接近的分钟,29.999 秒或更高的 smalldatetime 值向上舍入为最接近的分钟。--returns time as 12:35
    SELECT CAST('2000-05-08 12:35:29.998' AS smalldatetime)
    GO
    --returns time as 12:36
    SELECT CAST('2000-05-08 12:35:29.999' AS smalldatetime)
    GO注释
    Microsoft SQL Server 用两个 4 字节的整数内部存储 datetime 数据类型的值。第一个 4 字节存储 base date(即 1900 年 1 月 1 日)之前或之后的天数。基础日期是系统参考日期。不允许早于 1753 年 1 月 1 日的 datetime 值。另外一个 4 字节存储以午夜后毫秒数所代表的每天的时间。smalldatetime 数据类型存储日期和每天的时间,但精确度低于 datetime。SQL Server 将 smalldatetime 的值存储为两个 2 字节的整数。第一个 2 字节存储 1900 年 1 月 1 日后的天数。另外一个 2 字节存储午夜后的分钟数。日期范围从1900 年 1 月 1 日到 2079 年 6 月 6 日,精确到分钟。
      

  3.   

    你可以设置成smalldatetime,然后在存入数据时做格式化处理一下,然后只存入小时和分钟就行了。