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

SELECT	*
FROM	v_CreditListing C
WHERE	LEFT(CONVERT(VARCHAR(50), C.CreditNoteDateTime, 120) , 10)  
			BETWEEN LEFT(CONVERT(VARCHAR(50), @DateFrom, 120) , 10) AND LEFT(CONVERT(VARCHAR(50), @DateTo, 120) , 10)
ORDER BY C.CreditNoteDateTime
