Trim Leading
I have a textarea, that when you insert your cursor into it anywhere except for in the very first line, the cursor falls into the second line. When the form is submitted there is a carriage return at the beginning of the text that I'm having trouble getting rid of.
I tried to Trim() the string both before inserting it into the database and when writing it to the page, but apparently that doesn't strip off carriage returns (even though I've read it does.)
View Replies
ADVERTISEMENT
I need to display the leading zero on dates and times for all dates and times e.g 02/02 for February 2. I only get 2/2 or 08:00 for 8 o'clock in the morning.The code I'm using Code:
Day(Now())
Month(Now())
Hour(Now())
View Replies
View Related
I need to display the time in military form. I came up with the following:Code:
<%= (hour(now)) & ":" & Minute(now()) & ":" & Second(now()) %>
And this works pretty well, except I get things like this:
8:5:2 for 08:05:02
14:2:17 for 14:02:17 (2:02:17 PM)
How do I get the leading zeros before the number if it is less than 10?
View Replies
View Related
I am inserting a telephone number into an Access db. The field is set to a number, with no input mask or formatting. Whenever I insert a number beginning with a 0 as most telephone numbers do, it removes the leading 0.
View Replies
View Related
im inserting some data into a number field but when i have something like 0000006 it chops it to 6 in the database. and not always are the same number of zeros present. why im not sure just what i have to work with.
I understand that i could make the db value varchar and just validate it by doing something like Isnumeric. But is there a way to keep my zeros but leave it a number field.
View Replies
View Related
How do I go about inserting a number into a varchar column without it being stripped of the leading zero? IE. I'm trying to insert 012345 into a varchar column, but what gets inserted is 12345.
View Replies
View Related
I'm UPDATING a value into an Access text field from a page but I can't get it to do the UPDATE without adding a leading space to the value??
This is a problem because I have another page where a user can search the entries, but when they do a search by this particular criteria, it returns no entries (ie. Search good_bad by "Positive" returns no results, but Search good_bad by " Positive" will return the proper results).
The value is coming from a option select box. It seems to only be a problem doing an UPDATE using a value from a select box as I'm using the EXACT same code to do an INSERT where the value comes from an INPUT box and it inserts with no leading space?? Code:
View Replies
View Related
I have a form that pulls a zip code and insterts it into a access database via ADO/ASP. When the data is inserted with a 0 in the front (ex: 03490) the leading zero is dropped.
Anyone know a quick solution for this problem, without having to add validation to the database (zerofill, etc) ie; some ASP function...
View Replies
View Related
I'm pasing a zip code as a prameter to an Access stored procedure. In
Access the parameter is a text data type. It works for non-leading zero
zip codes but, apparently access (or ASP) is converting it to a value
first (dropping the zero) then sending that to my SP.
Even if I use cStr() to be sure the parameter is sent a string it still seems to drop
the leading zero. Any thoughts? Note: It needs to be a string for canadian zip
View Replies
View Related
i'm having some trouble with the trim function. I have a date 04/18/1982. I want enter the value 1982-04 into the database. The code i'm using is:
strEXPDT = replace(right(left(request.form("Expiration_Date")2)4),"'","''")
View Replies
View Related
I am constantly in need of help, I am back again. I am slowly, slowly getting my page to work. Here is the latest of my queries. I want to automatically make a username by trimming the first character of the first name and taking the entire last name, and putting it in strUserName, I am a little iffy about TRIM (what else is new) rofl. Anyway the user name I want to take the first 3 characters from postal/zip code and the first three numbers from phone number and make the password. Here is what I am thinking of course it doesn't work. BIG SURPRISE!!!
strUserId = Trim(RS("FName"),1) & RS("LName")
strPassword = Trim(RS("PCode"),3) & Trim(RS("Phone"),3)
View Replies
View Related
I am converting bites to Megabytes in an operation. How would I trim the result to only go to 2 decimal places?ex:
Response.Write(file.FileName & " (" & (file.Size/1048576) & "Mb)<BR>")
View Replies
View Related
This should not be this tough but I may be thinking too hard about it.
Here's what I have:
thenames="charles,sam,chris,"
How do I do remove the last comma? I tried using trim and replace
together but couldn't get it.
View Replies
View Related
I'm creating a website that will have a page that lists current news
items. The news items will be stored in a SQL Server database and will
have basically two fields, the date and the news blurb . . . On the
main page of the site, I want to have a box that shows "Current News"
and only pulls the first 7 or so words from the news blurb followed by
a ... [more] where [more] is a link to the current news page.
For example, the database entry may be something like this: Code:
View Replies
View Related
How do i cut the last 4 characters in a string?
I know how to cut the 4 first, but i need to cut the last!
I have a image name like testimage.gif and I want to cut away .
View Replies
View Related
i need to use the trim function trim("str","?"). How do i remove the "return sign" from a string?
View Replies
View Related
how to use ltrim, rtrim to trim the beginning and end of text entries for extra spaces. I was wondering if there is a way to trim extra spaces from WITHIN a text entry.
Example:
change
John and Linda
to
John and Linda
View Replies
View Related
I need to select records from table where right part of Field1 = strTest
the table looks like:
Field 1 Field2 Field3
5159-10 2 3
5159-20 6 9
LS5598-20 8 9
strTest=5159 or LS5598 doesn't matter
should be something like "select Field1 from tabTest where " & Right(Field1, 3) & " like " & strTest & "
Obviously I'm wrong somewhere, could anyone tell me where?
View Replies
View Related
does anyone know if it's possible to crop whitespace regions from around the edges of an image using Imagemagick?
I have a whole bunch of signature images (as in, people's handwritten signatures) and I'd like to crop them so that there's no whitespace margin around them. I can do the cropping fine, it's just detecting the color regions.
View Replies
View Related
I need to do is remove ALL characters after and inc the characters "." found in a variable. i have a variable which holds device with DNS name such as E096064-FWSM2.netdevice.companyname.com
i want the variable to just hold the name E096064-FWSM2 the extension after the first "." can very greatly so i can not specify all possible options as i just do not know what they are going to be.
View Replies
View Related
I make a csv file with values from data base fields . If my value contains a carriage return caracter at the end, a new line is created in my csv file. I tried to replace chr(13) caracter by an empty caracter but it doesn't work, my code is:
Replace(Trim(element.value), chr(13),"")
Do you have any idea to resolve my problem?
View Replies
View Related
I cannot figure out why this won't work, but I cannot get the trim() function to work for me. I tried this test code just to see if I could get anything:Code:
<%
String = "This is a string"
response.write String & "<br>"
Trimmed = Trim(String)
response.write Trimmed
And the results are both the same.This is a string.
Can anyone think of any good reason the Trim statement wouldn't be working I cannot think of any other common ASP function that isn't working for me.
View Replies
View Related
its ok to use just
Trim(Request.Form("txtFromName"))
or to use both
rTrim(ltrim(Request.Form("txtFromName")))
View Replies
View Related
Ok, I have this code:
For i = startCt To endCt
' Get the document title. If it's blank, set it to "Untitled".
Dim docTitle,path,desc
Dim tObj
Set tObj = results1(i)
docTitle = tObj("title")
path = tObj("vpath")
desc = tObj("desc")
.......
Now, results1 comes from the ms indexing server.
Problem with some of the results is the title is an empty string, so no link.
If I query the catalog in comp mgnmt, no problems.
So, indexing problem or something else.
I can use the path and get the doc name there if empty.
Also, does asp have a string.trim like .net? ....
View Replies
View Related