I want to calculate average customers will order
but when i calculate there's have a problem, mine is:
SELECT CustomerID, (MAX(SalesDate) - MIN(SalesDate)) / (COUNT(*) - 1)
FROM TrSalesHeader
GROUP BY CustomerID
HAVING COUNT(*) > 1
and i've message "Operand data type date is invalid for subtract operator."
can anyone help me to solve this problem? thankyou
