Solved

how set a column to a description concatenated with a value

Posted on 2010-11-29
4
235 Views
Last Modified: 2012-06-27
SET SubDescription1 = 'MTD:'  SubDescription1 + te.Quantity,

I'm trying to use this code but I'm getting the following error

Incorrect syntax near 'SubDescription1'.
0
Comment
Question by:solarisinfosys
  • 2
4 Comments
 
LVL 7

Expert Comment

by:luceysupport
ID: 34236869
should be

SET SubDescription1 = 'MTD:'  + SubDescription1 + te.Quantity

you may also need convert(nvarchar, te.Quantity)
0
 
LVL 4

Accepted Solution

by:
MSSystems earned 500 total points
ID: 34238641
Maybe try something like this

SET SubDescription1 = 'MTD:' + Cast([SubDescription1] as NvarChar(100)) + Cast([te].[Quantity] as NvarChar(100))

Open in new window

0
 

Author Closing Comment

by:solarisinfosys
ID: 34253714
MSSystems
 
Thank You. this is exactly the solution I was looking for.
0
 
LVL 7

Expert Comment

by:luceysupport
ID: 34255324
The solution to your problem was the + was missing as per my response. You did not specify the data types of your columns so I don't see how an answer that assumes them could be more correct.

I would object to how these points were awarded
0

Featured Post

Get up to 2TB FREE CLOUD per backup license!

An exclusive Black Friday offer just for Expert Exchange audience! Buy any of our top-rated backup solutions & get up to 2TB free cloud per system! Perform local & cloud backup in the same step, and restore instantly—anytime, anywhere. Grab this deal now before it disappears!

Join & Write a Comment

Hi all, It is important and often overlooked to understand “Database properties”. Often we see questions about "log files" or "where is the database" and one of the easiest ways to get general information about your database is to use “Database p…
If you have heard of RFC822 date formats, they can be quite a challenge in SQL Server. RFC822 is an Internet standard format for email message headers, including all dates within those headers. The RFC822 protocols are available in detail at:   ht…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now