![]() you need to use sp_executesql.whats the purpose of dynamic sql here?. You cant return values like this in dynamic sql using EXEC. You are building a sql string, but you are trying to concatenate a with a Try this SET = 'DECLARE intSELECT = 'JimEveryday I learn something that somebody else already knew Hi guys I am having a problem I am pass variable to the datediff function but i am getting this error Msg 295, Level 16, State 3, Line 11Conversion failed when converting character string to smalldatetime data type.Below is the code i am using declare TINYINT, CHAR(6), REAL, MONEY, INT, SMALLDATETIMESET = 3SET = getdate()SET = 'MONTH'SET = 2SET = 'SELECT = someone assist me in saying or showing what am i do wrongThanks in advance Applies to: SQL Server (all supported versions) Azure SQL Database Azure SQL Managed Instance Azure Synapse Analytics Analytics Platform System (PDW) This function returns the count (as a signed integer value) of the specified datepart boundaries crossed between the specified startdate and enddate. ![]() We've got lots of great SQL ServerĮxperts to answer whatever question you can come up with.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |