Making Field a hyperlink

  • Hello, I have a script that returns two columns. The first is a title field, the 2nd is a hyperlink. What I want to do is make the first field a hyperlink using the 2nd field. Example:

    Title = Test Document URL = http://www.yahoo.com

    I want to make Test document equal to http://www.yahoo.com as a hyperlink.

    Also I'm saving as XML. Any help or suggestions would be appreciated.

  • Well, you could either do this as string concatenation in T-SQL, or, better, have the front-end do this for you.

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • I'm running this query from Sharepoint, so I'm unable to mess with the tables. How would I do this with concatenation? Basically I'm doing a select statement and grabbing two columns the Title and URL which are seperate. How would I concatenate the Title field to make it a URL? Also I'm saving it in XML format.

    Sorry but I haven't used T-SQL in a long time and now have to write scripts to pull back info. into sharepoint.

  • It's been a while since I hand-wrote a hyperlink but it goes something like this:

    select '[a href="' + URL + '"' + Title + ']'

    from table

    (Use carrets where I've got brackets, of course. Forum software won't let me use carrets that way.)

    If you know how to format the link, it's just a matter of adding the text to the columns, using +.

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • Thanks SS I appreciate it.

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply