Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 display-help please

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,c
I want it to display abc instead of a,b,c

Thanks

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
Go to Top of Page

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

Go to Top of Page

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>
Go to Top of Page

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",",",""))%>

Go to Top of Page

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
Go to Top of Page

amy
Starting Member

30 Posts

Posted - 2002-06-20 : 15:55:02
Oh ok , Sorry

Go to Top of Page

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"), ",","")%>



Go to Top of Page

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.

Basically
request.form("chkMyCheckbox") returns an array

Michael



Go to Top of Page
   

- Advertisement -