简体   繁体   English

将 DATETIME(日期时间)转换为季度(整数) SSIS

[英]Converting DATETIME(Date Time) to Quarter(int) SSIS

I need to convert datetime to Quarter.我需要将日期时间转换为季度。 I have date time as the date type - 2009-01-01 00:00:00.000我有日期时间作为日期类型 - 2009-01-01 00:00:00.000

how do I convert this 01 to Quarter "1" for example?例如,如何将此 01 转换为季度“1”?

Per the documentation you can use the datepart function with the q or qq argument:根据文档,您可以将日期部分datepartqqq参数一起使用:

datepart("q", YourDateColumn)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM