Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Database > SQL Language
|
SQL Language SQL Language discussions not specific to a particular RDBMS program or vendor.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Language section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 12th, 2004, 05:49 AM
Friend of Wrox
 
Join Date: Jun 2004
Posts: 245
Thanks: 0
Thanked 0 Times in 0 Posts
Default Convert int to nvarchar

Hello
I can't find solution in any books. I am doing an html concatenation in sql with sql columns:

Set HtmlReady =
'<H1><A HREF="http://' + LINK + '" target="_blank"><img src="c:\inetpub\wwwroot\OCVBUG_Book\images\' + IMAGESM +'" border="0" align="Center"></A></H1><H2><A HREF="http://' + LINK + '" target="_blank">' + Title + '</A></h2>

<DIV CLASS="SPONSORSLINK"><P>' + [BRIEFDESC]+'
<BR>
<BR><A HREF="http://book2.aspx?BookID=' + BookID +'" > Read more ... </A></P></DIV>'

I get the error:
Syntax error converting the varchar value '" > Read more ... </A></P></DIV>' to a column of data type int.

How can I include a convert in this code????
I don't want to write a separate code.

 
Old August 12th, 2004, 06:33 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,212
Thanks: 0
Thanked 1 Time in 1 Post
Default

You need to CAST the BookID field to a varchar if you want to include it in the middle of that string
...<BR><A HREF="http://book2.aspx?BookID=' + CAST(BookID AS varchar) +'" > Read more ... </A></P></DIV>'





Similar Threads
Thread Thread Starter Forum Replies Last Post
Convert from nvarchar(25) to smalldatetime aspless SQL Language 6 September 14th, 2007 09:21 AM
convert data from nvarchar to Date Time rahulgzb SQL Server 2000 4 September 7th, 2007 09:45 PM
convert nvarchar to money smatyk SQL Server 2000 2 October 26th, 2006 06:37 PM
Convert a char to int!!!!?? vtvb C++ Programming 6 March 18th, 2006 05:51 AM
Can't convert type 'bool' to 'int' Gjerstad BOOK: ASP.NET Website Programming Problem-Design-Solution 2 July 9th, 2003 10:33 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.