ayi30
select convert(smalldatetime, convert(char(10),SSD_SellRecord.VoucherTime,120)) as VoucherTime
from SSD_SellRecord group by convert(smalldatetime, convert(char(10),SSD_SellRecord.VoucherTime,120))


      因为要根据日期来group by,所以用convert(char(10),SSD_SellRecord.VoucherTime,120)截取日期部分。又因为我们希望的最终结果是时间类型,所以还得用convert(smalldatetime, convert(char(10),SSD_SellRecord.VoucherTime,120))进行转换。

分类:

技术点:

相关文章:

  • 2022-12-23
  • 2021-12-05
  • 2021-09-27
  • 2022-01-01
  • 2021-09-30
  • 2021-06-03
猜你喜欢
  • 2021-08-01
  • 2021-11-30
  • 2022-12-23
  • 2022-02-08
  • 2021-06-10
  • 2022-12-23
  • 2021-06-26
相关资源
相似解决方案