merge columns

  • Hello,

    I have two columns.  One with a person's name and another of that person's dog.  What I want to do is merge the columns into one so that the person's name appears and then the dogs right under.  Then the  next person, then their dog, etc.  Any idea on how to do this?

    Sarah

  • Looking for something like this?

    Select PersonName + ', ' + DogName as FullName from dbo.YourTable

    Note that this assumes that you don't have nulls in the table.

  • no...I definitly need the dog on the line below the owner.

    Is there a write line command or something to make the dog go to the next line?

  • Select PersonName + Char(13) + char(10) + DogName as FullName from dbo.YourTable

    BTW this is something that you should do on the client side, not in the query. It's something very easy to do in vb.

  • how would you do that in VB?

  • me.txtbox.text = myrs.fields("Field1").value & vbcrlf & myrs.fields("Field2").value

  • Or actually put the 2 textbox one above the other .

Viewing 7 posts - 1 through 7 (of 7 total)

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