Go Back   CodingForums.com > :: Server side development > ASP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 03-20-2006, 03:56 PM   PM User | #1
parallon
Regular Coder

 
Join Date: May 2005
Posts: 215
Thanks: 14
Thanked 0 Times in 0 Posts
parallon is an unknown quantity at this point
concatenate multiple records

Hello all. I am a little new to Variables in ASP, and a little confused on concatenating multiple variables together. I have fields in the database for EmpNo, EmpFirstName, and EmpLastName, and what I want to do is to is enter all three values together in a field i.e. 13 - John Doe.

This code is working for 1 value, but not sure how to get the other two:
Code:
<td width="60"><div align="left"><%=(rsUserName.Fields.Item("EmpNo").Value)%></div></td>
Granted, I could repeat the part between the <% %> tags for each record, which did work, but is that the best way? If so, how would I put spaces between each item?

Thanks in advance,

Parallon
parallon is offline   Reply With Quote
Old 03-20-2006, 05:13 PM   PM User | #2
degsy
Senior Coder

 
Join Date: Nov 2002
Location: North-East, UK
Posts: 1,265
Thanks: 0
Thanked 0 Times in 0 Posts
degsy is on a distinguished road
Code:
<%=(rsUserName.Fields.Item("EmpNo").Value)%> - <%=(rsUserName.Fields.Item("EmpFirstName").Value)%> <%=(rsUserName.Fields.Item("EmpLastName").Value)%>
or
Code:
<%
Response.Write (rsUserName.Fields.Item("EmpNo").Value) & " - " & (rsUserName.Fields.Item("EmpFirstName").Value) & " " & (rsUserName.Fields.Item("EmpLastName").Value)
%>
degsy is offline   Reply With Quote
Old 03-20-2006, 08:38 PM   PM User | #3
parallon
Regular Coder

 
Join Date: May 2005
Posts: 215
Thanks: 14
Thanked 0 Times in 0 Posts
parallon is an unknown quantity at this point
That worked perfect.

Thanks,

Parallon
parallon is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 04:49 AM.


Advertisement
Log in to turn off these ads.