Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Recent content by saravananpk

  1. saravananpk

    how to convert ':00:00.000' to varchar

    hi Terry L. Broadbent, thanks, i made a silly mistake in that. sorry for that. it is working fine now. regards pks.
  2. saravananpk

    how to convert ':00:00.000' to varchar

    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 =...
  3. saravananpk

    how to convert ':00:00.000' to varchar

    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.
  4. saravananpk

    how to convert ':00:00.000' to varchar

    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.
  5. saravananpk

    assigning column name runtime

    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 ' +...
  6. saravananpk

    assigning column name runtime

    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 *...
  7. saravananpk

    display weeks between 2 dates

    thanks it is working fine.
  8. saravananpk

    display weeks between 2 dates

    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.

Part and Inventory Search

Back
Top