Trimming Db Results
i don't know what to do here exactly.
i have seen the TRIM function, but i'm not sure if it's the right way to do it.
i have a recordset called RSUSEREDIT.
in the recordset there is a column called "EMail".
i can print out the results using Code:
<%=RSUSEREDIT("Email")%>
the email column always uses the same domain name... - username@domain.com
is it possible to remove the part after and including the "@"?
View Replies
ADVERTISEMENT
My record returns a numerical string "02". When I response.write it I want to remove the "0" ONLY from the beginnings. How would I do that?
View Replies
View Related
I know that trim removes white space and the LTrim and R trim removes space from the left or right but how would i trim a string after 20 characters so that i could add ... to the end of the new trimmed string???
View Replies
View Related
if i had a string which looked like this :
,apple, orange, grape, tomatoes
how do i remove the first character[,] from the string using the trim() function?
View Replies
View Related
I'm dynamically building an SQL string to do an execute, and keep ending up with a leftover comma, so the string looks like this.
INSERT INTO Software ( Title, Version, Licensing, Total_Licenses, support_phone, support_email, Campuses_Licensed, Comments, support_web, FundingSource, Course_title, Subject, Grade_level, LocalExpert, ACTIVE, CATE, EntryDate,) VALUES ( 'Bob's Super Crappy Software', '4.3', 'labpack', '36', '555', '555', 'Alexander, Bilhartz, Central, Fairmeadows, Hyman, Daniel', 'James is testing this', 'www.bob.com', 'Campus PO', 'Math', 'Math', '4, 5, 6', 'Patrick Williams', '1', '0',)
Both commas are added dynamically and can be trimmed on the fly. I tried using RTRIM(strSQL, ",") but this didn't work.I put the fields into an array and tried to add only commas to all but the last entry, but that also didn't work.
View Replies
View Related
I have a database field that is a memo type. I would like to be able to only display the first 50 words from the database. I would like for it to show ..... after about 50 words.
I am using <%=Content %>. How do I trim this field to show only 50 words and then ....?
I tried the following code:
Function LengthTrim(input, length)
If Len(input) > length Then
Return Left(input, length) + "..."
Else
Return input
End If
End Function
then <%= LengthTrim(Content, 50) %>
But it would not work. I got the following error message:
Microsoft VBScript runtime error '800a01f4'Variable is undefined: 'Return' .
View Replies
View Related
I am storing URL in a database for a 'sort of' directory type website.The <a href> is built from the recordset of URL's which is all working no problem, easy stuff.What I have found is going to be necessary in some cases is to trim the URL back to just it's www.abc.co.uk address for the link display.
I still want the actual link to go to it's long 'deep linking' location, but there is limited room for displaying a URL that could be a hundred chars long.
View Replies
View Related
Code:
StartTime = FormatDateTime((rs("startdate")),3)
this returns
7/4/2006 1:00:00 AM
I need to trim the seconds off so it looks like this
7/4/2006 1:00 AM
View Replies
View Related
I have a section on my website that lets users to input their own username and password in order to enter the restricted area, but i notice that some of the users likes to use strange characters to use as their username or password.
how could I trim those strange characters ie. like the follow !@#$%^&*()'{}/?~ out of the input field, WITHOUT using the javascript because javascript can be disabled from the browser and by only using the ASP IF ELSEIF statements to do so?
View Replies
View Related
I have an Access db of products which I'd like to use for creating dynamic urls. Each product has a range name which I intend to use to point to the folder containing the relevant image eg pine/001.jpg
My problem is one of the ranges has two names ie Indian Accessories. I can't have a url with a space in it so how can I dynamically alter the field so that it displays the url as either indianaccessories or indian-accessories?
View Replies
View Related
I need to trim a variable to have everything after 4 chars in a string.
IE:
var_temp = 200:16:1234567890
i want everything after 200: to be a variable.
I cannot use:
var_new = right(var_temp,14)
because the string is a different length everytime.
I just dont know this function.
View Replies
View Related
Someone should write a book Javascript for VBScript Programmers. I can't seem to find a native function in Javascript to trim a string. Is there one or does anyone have one handy?
View Replies
View Related
if i have a value of 11.7908787541713
how could i trim it to 11.79 and how do i round the number up?
View Replies
View Related
I am taking a field from a database and attaching it to avariable like so:
varID = rsCheckLogin("LogonID")
This is returning, for example, SA70.
I only need the integer part. How would i remove the SA part, i have belive it must be trim or split but not sure how to use them?
View Replies
View Related
i have a search page results what i want to do is trim the result to 100 chars either side of the matched word but say if the word is at the start or end just to trim 100 chars left or right. does anyone have a function that will do this ?
View Replies
View Related
if iam requesting a form field, how do i trim that to just the first 2 letters Code:
View Replies
View Related
I am trying to make a search page. Once a serach word or words is put in I need it to serach multiple product tables and output the description of any prioduct if the search word is present in the description.
However, If i put in 2 keywords like "paper sticker" I get no results. How do you search multiple keywords? Code:
View Replies
View Related
Anybody know how to get only the 10 latest results of an SQL query ?(in SQL)
View Replies
View Related
i have a record that is returned by the database as domain/username. i want to be able to strip off "domain/" and just display "username". is this possible? if so, how would i go about doing this?
View Replies
View Related
I have a URL... everything returned by the url, I need to write to a file. lets say its 40 lines of text... how can I write it to a text file and save it??
ADODB stream?
FSO?
DomObject?
View Replies
View Related
I'm creating a site that pulls details from a database & display it on screen. Problem is that there's sometimes loads of data which makes the page huge. What I want it to do is display ten and a next page link to display the next ten. Like the way Google displays results. Problem is I don't know how to generate pages on the fly. So the question is can it be done and does ne1 know how to do it?
View Replies
View Related
First, thanks to all who have helped me over the last few weeks !!
I have a form that allows the user to select multiple options.
These are user names:
Fred S
Bob D
Paul G
Dave O
When the form is submitted, I'm getting the details using
user = request.form("user")
this is returning the mutliple options.
What I would like to do is pass all the options to 'user' but at one
point on the results page only show the first user selected, not the
multiple selection
View Replies
View Related
what is an easy way to go about sorting my search results through links, you know, like clicking the link at the top of a column. i know how to pass the order by in a querystring:
http://www.example.com?lastname=smith&firstname=john&state=GA&orderlast=desc
where orderlast is the order querystring.
but what about all the other links? what do I do with the previous querystring entries like lastname, firstname, and state? i find if i add orderlast to my lastname column and i click on it, i will have 2 orderlast querystrings
View Replies
View Related
I'm using multiple recordsets on a page, and they are all returning correct results and enough of them. My problem is when I try to access the recordcount property rs.recordcount, they all return a result of -1. This would usually mean that no records are returned. So why is showing my recordsets that are displaying records with recordcounts of -1. I can't seem to figure out.
View Replies
View Related
what I need is to dysplay only the first say 10 results and then have a link 'next' and dysplay 10 more in a new page
result
result
result
result
...
next
I can create a var and add 1 more for each result, till 10� end then create the link, but i don't now how to start the new page from the 11� result.
View Replies
View Related
I know how to display results that contain html code on a page. (ie. <br>
<b>...)
what i would like to know, is if a result contains bbc code (ie.. [code]
[url]..) how would i display that to be readable?
This is not for a forum, but would be the same as if i was writting a forum.
I think there is a script that the page has to contain to be able to read it
correctly, but I can't find it.
View Replies
View Related
I have following code, picking an ID and saving it to Cookies.
<%
ItemID = Request("prod")
Response.Cookies("THREES")(ItemID) = Request("prod")
Set rdset=objConn.Execute("SELECT ID, Name, Large, Description
FROM shop_products WHERE ID=" & ItemID)
%>
In IE it works fine as it should, adding item id to Cookies
In Firefox it gives me the following error:
Cookies object, ASP 0102 (0x80004005)
The function expects a string as input.
/shop/addcart.asp, line 27
Any information on that. Any idea what is going wrong.
View Replies
View Related
My SQL statement won't return results where any field in a record is blank. What can I do to fix this?
strSQL = "SELECT * FROM newarchive WHERE Program_Title LIKE '%" & program & "%' AND Year_Aired LIKE '%" & yearA & "%' AND Sponsor LIKE '%" & sponsor & "%' AND Month_Aired LIKE '%" & monthA & "%' ORDER BY ID"
It gets its values from a form where some fields can be left blank. If the record itself does not have a blank field, the search will pick it up. But if the record contains a blank field, then it won't be selected unless it matches the Program_Title data.
View Replies
View Related
Is there any sample about getting the results from executing an exe using
asp?
View Replies
View Related
I know how to use the LIKE command in a query but how do I do it in the
results of a recordset results="<b>Hello</b> World"
I want to search the above result and if it has a <B> in it, I want set
hasabold="Y"
I need to be able to search through a large amount of text so the BOLD marks
will not always be at the front of the results. They maybe be on line 50
character 59,
View Replies
View Related
query = "SELECT table. * FROM table where table.lastname=" & lname
How can I fetch all the rows with the lastname field equals to lname variable?
View Replies
View Related
I have programmed several online forms(typically using cgi).A client of mine does not like how the results are formated (the long column of text)Is there anything I can do to program the results of this online form to get put into another format that would be e-mailed to the receipient?
View Replies
View Related
i have a results page on a webpage and i was wondering if it was possible to dump these results (they are stored in a database)into a excel spread sheet?
View Replies
View Related