Count days in date range?

后端 未结 5 1694
无人及你
无人及你 2021-01-20 10:57

I have a query like this:

SELECT COUNT(*) AS amount
FROM daily_individual_tracking
WHERE sales = \'YES\'
AND daily_individual_tracking_date BETWEEN \'2010-01         


        
5条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-20 11:03

    This depends on what SQL server you're using.

    If you're using MS-SQL Server, you can use the function DateDiff

提交回复
热议问题