hi Terry L. Broadbent,
even then iam getting the same error
Server: Msg 170, Level 15, State 1, Line 1
Line 1: Incorrect syntax near '00'.
the problem is iam adding '02:02:10.000' (sample time) to datetime
datetimevar & distributiondatetime are datetime
set @datetimevar =...
sorry, the problem was not due to that.
i tried to add the time part to datetime.
set @datetimevar = @distributiondatetime + @hour
in this hour is in the format 'hh:mm:ss' but of type varchar in the table.
when i tried to add this varchar to datetime iam getting that error.
i tried to convert ':00:00.000' to varchar using
convert and cast.
convert(varchar(20),':00:00.000')
but iam getting the following error.
Server: Msg 170, Level 15, State 1, Line 1
Line 1: Incorrect syntax near '00'.
how to convert that string to varchar.
well, i have solved that query.
declare @query nvarchar(100)
declare @table_name nvarchar(100)
declare @col1_name nvarchar(100)
declare @col1_value nvarchar(100)
set @table_name = 'tablename'
set @col1_name = 'columnname'
set @col1_value = 'two'
SELECT @query=
N' select * FROM ' +...
i have a table with columns
number int
name varchar
-----
declare @colname varchar(20)
set @colname = 'name'
select * from tablename where @colname = 'somename'
------
iam passing the column name (here->name) to a procedure which does the above.
actual query during runtime is "select *...
hi,
how to display all the weeks between 2 input dates.
for ex. if start date is 12/03/2002 and end date is 14/06/2002, i need to display all the weeks starting from
12/03/2002. the output should be,
12/03/2002,18/03/2002,25/03/2002 etc. till end date.
sa.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.