FAQ
I am trying to create a query that will include HTML code for a link for a datagrid that I've got. However, I'm getting the error, "Truncated incorrect DOUBLE value" when I execute the following query:

SELECT *,
'<a href=CamperSelItems.aspx?ID=' + CAST(ID AS Char) + '>Select Items</a>' AS ItemLink
FROM Campers
WHERE FamilyID=1

If I replace the CAST(ID AS Char) statement with 1, and remove the quotes around it ('<a href=CamperSelItems.aspx?ID=1>Select Items</a>') it works just fine. So, I know that it's the ID field, and how I'm trying to get that to be part of the link that it's got a problem with. So, what is the correct way to do this?

Thanks,
Jesse

Search Discussions

  • Jesse at Jan 24, 2006 at 3:25 pm
    Never mind,
    I've found that if I use CONCAT(), it works just fine. It's hard for me to
    get used to using CONCAT instead of just using the "+". I've made this
    mistake several times.

    Thanks,
    Jesse

    ----- Original Message -----
    From: "Jesse" <jlc@msdlg.com>
    To: <mysql@lists.mysql.com>
    Sent: Tuesday, January 24, 2006 10:23 AM
    Subject: Truncated Incorrect Double Value


    I am trying to create a query that will include HTML code for a link for a
    datagrid that I've got. However, I'm getting the error, "Truncated
    incorrect DOUBLE value" when I execute the following query:

    SELECT *,
    '<a href=CamperSelItems.aspx?ID=' + CAST(ID AS Char) + '>Select Items</a>'
    AS ItemLink
    FROM Campers
    WHERE FamilyID=1

    If I replace the CAST(ID AS Char) statement with 1, and remove the quotes
    around it ('<a href=CamperSelItems.aspx?ID=1>Select Items</a>') it works
    just fine. So, I know that it's the ID field, and how I'm trying to get
    that to be part of the link that it's got a problem with. So, what is the
    correct way to do this?

    Thanks,
    Jesse

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupmysql @
categoriesmysql
postedJan 24, '06 at 3:20p
activeJan 24, '06 at 3:25p
posts2
users1
websitemysql.com
irc#mysql

1 user in discussion

Jesse: 2 posts

People

Translate

site design / logo © 2021 Grokbase