471,075 Members | 916 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,075 software developers and data experts.

Concat ??

Hi

I'm not sure about the right 'term' of this question. I'm using MS SQL server 2000 standard edition in a Windows 2003 Server Enterprise edition.

I have two tables. One of this has several columns (Year,Month,Day,User,Message). The other one, have just one column called Messages.

I count the today's messages in the first table using the following syntax

SELECT COUNT(*) FROM Tab1 WHERE YY = (datepart(year, getdate())) AND MM = (datepart(month, getdate())) AND DD = (datepart(day, getdate()))

Now, I have to update the column Messages in Table2, but I must to add a text before the count result. I.E.

'Messages today = 25'

Hoy may I add the text before the SELECT COUNT query result ?? Is it possible ??

Thank you.
Jun 21 '06 #1
1 7054
Try this syntax

select emp_id, 'Messages today = ' + convert(varchar(10),count(1)) from table group by empid

Prasad
Jul 6 '06 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

4 posts views Thread by Gerald Aichholzer | last post: by
3 posts views Thread by Bryan Valencia | last post: by
16 posts views Thread by Jacky | last post: by
8 posts views Thread by Doug Stiers | last post: by
4 posts views Thread by Martin Fletcher | last post: by
1 post views Thread by Trint Smith | last post: by
3 posts views Thread by Mythran | last post: by
4 posts views Thread by Martin Evans | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.