Quantcast
Channel: SQLServerCentral » SQL Server 2014 » Development - SQL Server 2014 » Latest topics
Viewing all articles
Browse latest Browse all 3145

Query issue 2

$
0
0
Hi if any one have solution for this please let me know.i am getting the below convertion issue when i run the below mentioned query.Msg 241, Level 16, State 1, Line 2Conversion failed when converting datetime from character string.Declare @StartDate Datetimeset @StartDate =convert(varchar(10), getdate(), 101)+(CAST(DATEPART(hh,(SELECT [Value] FROM tbltime WHERE NAME='TIME')) AS VARCHAR) +':'+ CAST(DATEPART(mi,(SELECT [Value] FROM tbltime WHERE NAME='TIME')) as VARCHAR) +':'+ CAST(DATEPART(ss,(SELECT [Value] FROM tbltime WHERE NAME='TIME')) AS VARCHAR)+CAST(DATEPART(ss,(SELECT [Value] FROM tbltime WHERE NAME='TIME')) AS VARCHAR))print @StartDateplease let me know if anybody have the solution for the same.i need to get the result as mentioned below.08/29/201316:30:00

Viewing all articles
Browse latest Browse all 3145

Trending Articles