Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Add character to varchar

Author  Topic 

maarten.del
Starting Member

17 Posts

Posted - 2009-08-05 : 04:33:15
Hi,

I do this...

DELETE FROM [mona].[dbo].[TB_CR_Tellerstanden_LOT_2]

INSERT INTO [mona].[dbo].[TB_CR_Tellerstanden_LOT_2]
([RtuTimeStamp]
,[Tag]
,[Value])

SELECT TOP (100) PERCENT RtuTimestamp, RtuName, isnull(MeasValue, 0) as MeasValue
FROM dbo.HisLog
WHERE (RtuTimestamp >= Convert(datetime,(left(CONVERT(nvarchar, (CURRENT_TIMESTAMP - 10), 20), 10)))) and (SUBSTRING ( TagName ,6 , 3 )= 'ATE')ORDER BY RtuTimestamp desc, RtuName



I copy values from Hislog to TB_CR_Tellerstanden_LOT_2 but want to at 'R' to the RtuName at the end. How do i do that?

Thanks in advance.

Maarten

be green, leave it on the screen

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2009-08-05 : 04:59:49
SELECT TOP (100) PERCENT RtuTimestamp, 'R' as RtuName, isnull(MeasValue, 0) as MeasValue
FROM dbo.HisLog
WHERE (RtuTimestamp >= Convert(datetime,(left(CONVERT(nvarchar, (CURRENT_TIMESTAMP - 10), 20), 10)))) and (SUBSTRING ( TagName ,6 , 3 )= 'ATE')ORDER BY RtuTimestamp desc, RtuName

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

maarten.del
Starting Member

17 Posts

Posted - 2009-08-05 : 05:38:23
Found it!!!

(RtuName + 'R') as RtuName


Thanks
Go to Top of Page
   

- Advertisement -