CREATE PROC [dbo].[sp_DebitListingByDate]
(
	@DateFrom DATETIME
	,@DateTo DATETIME
)
AS

SELECT	*
FROM	v_DebitListing D
WHERE	LEFT(CONVERT(VARCHAR(50), D.DebitNoteDateTime, 120) , 10)  
			BETWEEN LEFT(CONVERT(VARCHAR(50), @DateFrom, 120) , 10) AND LEFT(CONVERT(VARCHAR(50), @DateTo, 120) , 10)
ORDER BY D.DebitNoteDateTime
