I'm using the following:
Looking at the documentation for the CONVERT Function, the '103' should convert 'rndDate' to 'dd/mm/yyyy' format. However, it's converting to mm/dd/yyyy. Am I missing something ?Code:ALTER PROCEDURE [dbo].[usp_CountStatusRounds] @TableName sysname, @Date varchar(12) AS BEGIN SET NOCOUNT ON; EXEC('SELECT COUNT(*) FROM ' + @TableName + ' WHERE ' + 'CONVERT (varchar(10), rndDate, 103) = ' + @Date ) END




Reply With Quote