| Author |
Topic |
|
amy
Starting Member
30 Posts |
Posted - 2002-06-20 : 14:24:04
|
| hi,I have something like this in the database: a,b,c (because user select a, b,c from the form then submit into the database)but I want to display abc on the page with out comma then how can I do<%=objConn("name"%> will display a,b,cI want it to display abc instead of a,b,cThanks |
|
|
Page47
Master Smack Fu Yak Hacker
2878 Posts |
Posted - 2002-06-20 : 14:37:01
|
Do you realize how many times I had to read this to get your meaning?Look up REPLACE in books online....select replace('a,b,c',',','') Why would you store a comma-sepearated list of values in a relational database?<O>Edited by - Page47 on 06/20/2002 14:38:45 |
 |
|
|
amy
Starting Member
30 Posts |
Posted - 2002-06-20 : 14:58:25
|
| Because I have the form with couple check box for user to select so if they select a then b then c then they hit submit then it's insert a,b,c into the database, is there anyway to insert without comma in the database?Thanks |
 |
|
|
Page47
Master Smack Fu Yak Hacker
2878 Posts |
Posted - 2002-06-20 : 15:07:03
|
| Amy, I trust the REPLACE function works for you . . .You can disregard my other comment . . . Its more of a logical design issue, but if you design is working for you, great.<O> |
 |
|
|
amy
Starting Member
30 Posts |
Posted - 2002-06-20 : 15:37:55
|
| Here what I try but it not work, can you help?Thanks<%=request(Replace("Name",",",""))%> |
 |
|
|
Page47
Master Smack Fu Yak Hacker
2878 Posts |
Posted - 2002-06-20 : 15:51:04
|
| REPLACE is a T-SQL function, not an ASP function. Use the REPLACE in your SELECT statement. I am sure there is a way to do this in ASP but you've posted on a SQL board.....<O>Edited by - Page47 on 06/20/2002 15:51:44 |
 |
|
|
amy
Starting Member
30 Posts |
Posted - 2002-06-20 : 15:55:02
|
| Oh ok , Sorry |
 |
|
|
izaltsman
A custom title
1139 Posts |
Posted - 2002-06-20 : 15:57:50
|
| I agree with Page47 -- this sort of thing should be done inside the SELECT statement... But if you insist on doing this in ASP, you can probably do something like: <%=Replace (request("Name"), ",","")%> |
 |
|
|
MichaelP
Jedi Yak
2489 Posts |
Posted - 2002-06-20 : 16:56:44
|
| With those check boxes, there is a way to get them into "individual records." I can help you with that if you like.Basicallyrequest.form("chkMyCheckbox") returns an arrayMichael |
 |
|
|
|