C++
char szDateFrom[256];
char szDateTo[256];
BYTE btDateAll;
sprintf_s(szDateFrom, "%4d-%02d-%02d", tmStart.GetYear(), tmStart.GetMonth(), tmStart.GetDay());
sprintf_s(szDateTo, "%4d-%02d-%02d", tmEnd.GetYear(), tmEnd.GetMonth(), tmEnd.GetDay());
SQL
SELECT COUNT(*) FROM WT_purchase
WHERE market = @iMarket AND item = @iItem AND [date] between CAST(@szDateFrom as datetime ) and CAST(@szDateTo as datetime )+1
SELECT CONVERT (DATE, '2014-12-16')
, CONVERT (DATE, '2014/12/16')
, CONVERT (DATE, '20141216')
, CONVERT (DATETIME, '2014-12-16')
, CONVERT (DATETIME, '2014-12-16 15:10:01')
--결과 1 : 2014-12-16
--결과 2 : 2014-12-16
--결과 3 : 2014-12-16
--결과 4 : 2014-12-16 00:00:00.000
--결과 5 : 2014-12-16 15:10:01.000