Current location: Hot Scripts Forums » Programming Languages » ASP » Filtering Database Fields (ASP,Dreamweaver,MS Access)


Filtering Database Fields (ASP,Dreamweaver,MS Access)

Reply
  #1 (permalink)  
Old 01-23-04, 09:09 AM
v1brazy v1brazy is offline
Newbie Coder
 
Join Date: Jan 2004
Location: Newcastle - UK
Posts: 30
Thanks: 0
Thanked 0 Times in 0 Posts
Question Filtering Database Fields (ASP,Dreamweaver,MS Access)

Hya all,

Im currently designing a website in Dreamweaver MX, using ASP (Javascript) and MS Access.

What I need to do is retrieve all telephone numbers from the database and display it on the page. But i want it so only the first 5 numbers of the telephone number will show and the rest would be *****.

I have been looking at some SQL statements such as RPAD, LPAD, but it doesnt seem to work with my statements when building my recordset.

Can anyone give me some ideas please..

Thanks you all
Reply With Quote
  #2 (permalink)  
Old 01-23-04, 10:04 AM
Xtremist Xtremist is offline
Newbie Coder
 
Join Date: Aug 2003
Location: Pensacola, FL
Posts: 99
Thanks: 0
Thanked 0 Times in 0 Posts
search for truncate..... It will tell you all you need to know...

You will do something like this...

Create the recordset..... in this case it's called getphoneno.

Get the value from the DB and assign it to phoneno
<% phoneno =(getphoneno.Fields.Item("fphoneno").Value)%>

Now display it but cut it down to 5 numbers
<% = left (phoneno,5) %>

The output for 999-999-9999 would be 999-9. You could add some * so make it appear like: 999-9**-**** if you wanted....

If you wanted to show the last five you would use the work right instead of left and you can also use mid is you want to take some out of the middle.

Hope this helps,

Chris
__________________
Chris
http://www.pensacolawebdesigns.com
I know it's not much but I never find time to work on my own site
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
formmail problem gscraper Perl 12 08-27-04 03:06 AM
Dreamweaver and access database Gian79 ASP 4 01-25-04 09:10 PM
Searching all fields of a database. dallas PHP 9 12-18-03 07:33 AM
creating calculated fields in mysql resource after query Abu Mami PHP 0 07-31-03 06:47 AM


All times are GMT -5. The time now is 04:06 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.