我有一个数据类型为 datetime2 NOT NULL 的表。日期格式为“10/30/2013”,以下查询不提取信息。表中的日期存储如下“2011-12-25 21:28:58”
SELECT source_code,AMT,PURID
FROM SOURCEINFO WHERE
DATE_INSERTED BETWEEN CONVERT(DATETIME,'10/01/2011') AND CONVERT(DATETIME,'10/30/2013')
AND (SOURCE_CODE IS NOT NULL)
GROUP BY SOURCE_CODE