I have a few ASP pages for my companies web site that allows members to enter reports. A big problem I am running into is for dollar amount/numeric data. The entry line consists of 7 input boxes.
3 of those boxes are used for dollar amounts, but I am having a problem when the member types anything other than what is expected; instead of 32.56 they may type in 32..56 this is just one of the types of keying errors. When the page is submitted and the validation/update script runs I will get "Type mismatch: 'ccur' " errors and the script will stop. is there a way to validate the numeric data so I can avoid these problems?
I need to display in my form fields the last record in my access database, which is a numerical value, then add 1 to that value. The code i have so far is: Code:
I'm trying to write an SQL statement that will pull out only numbers from a field. Within that field will be records that contain text, but i just want the records that have numbers in that field. Can I say something like:
After moving my website from one server to another (Windows 2000, IIS 5, same as old server), I am forced to use the cInt function to convert all variables that compare against a numeric value.
For example, on the old server I could code something like this: If sRecCount > 0 then . . .
The new server requires me to use: If cInt(RecCount) > 0 then . . .
If I don't use the cInt function, I get a Type Mismatch error. I can't see anything that is different from one server to another.
I have a variable I'm pulling from a database that's a phone number in XXX-XXX-XXXX format. What I'm looking for is a way to strip out all non-numeric characters from the variable (XXXXXXXXXX). I don't want it to look only for "-", since sometimes, there are also alpha characters entered as well.
I made up a table in database with access consists of columns with text type. Some of them I put in data with numeric value and some of them I put in "Unlimited" as the value. Then, I allowed people to insert data but only with conditions. They can insert data if the value they are trying to insert is smaller than the one in the database. For "unlimited" value, they can insert any value. My problem is.... if the limited value in the database is 35, we cant insert data of 40 but we can insert data of 100. It seems that the code only takes the first number to be compared to the value in the database. Code:
I need some help on validating the number entered by the user in the ASP form . The number should be accepted in the format : 1,234.5648 and should be rejected in the format : 1, 234.456.46 or 1, 234.456 i.e. the format with more then one blank space or more then one decimal point etc.
i am trying with /^[0-9]*.[0-9]+$/; format. I checking all space and decimal point but also not taking data like 1.234
i need to check the text and not allow to have more than 7 digit number occur in the text and then change the 0123456789 to xxxxxxxxx.Finally the text will become :
Normally to declare a value as numeric I use Clng() HOWEVER I now have some Numeric values with decimal places, which I need to tell the page when they are picked up from the form that they are in fact numeric, but retaining the decimal places too, which would I use... as all the ones I have used previously Cint, Clng, Fix, etc. do not retain the decimal places.
"Microsoft JET Database Engine error '80040e14' Syntax error in INSERT INTO statement. "
I think it has to do something with the "minv" and "maxv" those two are numbers and if I remove them the INSERT command goes fine... but what am I doing wrong ?
I recently moved our website to a new server (Windows 2000 / IIS 5 - same as the previous server), and now I get type mismatch errors whenever a variable is compared against a numeric value, unless I use the cInt function to convert it to an explicit integer type.
For example, the following code:
dim sRecordCount [open a database and assign the record count to the above variable...] if sRecordCount > 0 then ...
On the new server I am forced to use: if cInt(sRecordCount) > 0 then ...
I can't figure out what has changed, if anything. Same OS version, same IIS version.
i have numeric value in my database with two decimal. now i have search page where user can type numeric value. so i want to compare user entered value with my db value. the result will give less than or equal value to user entered value. i had tried following
est = request.form("est")
sql = "select * from mytable where est_cost <= '%"&est&"%'"
but is not working. i think there is some syntax error in comparing numeric value.
I have a text file that I'm reading into a SQL table, from there I need to run various scripts on it to clean it up. One being, there is field that comes in as:
ie: JNJG12345 MAN5678 XY4656565
I need to split this by Alpha characters, then Numeric characters and be able to input them into seperate fields as such:
JNJG 12345 MAN 5678 XY 4656565
I have managed to locate a script that Memnoch came up with: http://forums.aspfree.com/t24666/s....ht=split+string that managed to get me where I am now.
How do I get the loop to stop once it finds the first occurence of a number? Below is the code I am using.
i have 3 columns in sql server . all of them are numeric value. when a user enter my site i take the value of userid (numeric one) i assign it as session("userid ") . after a query i take 2 value (both numeric again) from my table and write this code. if towhom=session("userid") then towhom=fromwhom . it gives an error .. how can i solve it. Type Mismatch Error .
I need to create an ADO Parameter object with the "Numeric" type. How do I go about this?
I thot that I'd be able to follow the pattern of creating ADO parameters with the more "regular" types (Varchar, Integer, etc..) but apparently, there's some conflict somewhere between my ASP line that calls ADO's CreateParameter method, the ADO Command's Execute method, and the SQLServer Stored Procedure's parameter declarations. Code:
I have 2 fields in my database. One is startDate one is endDate. I want to display records according the current date. So far I can select all records where the startDate is greater or equal to now by using Code:
SELECT * FROM items WHERE itemDateStart >= now
It seems the BETWEEN claus only accepts value, not fields. So basically I want to select * from items between itemDateStart and itemDateEnd
I have a need to be able to identify which fields within a database are key fields.I did find the Attributes property of the Field object contains information for a field in a recordset. One of those values for the Attributes property is identified as adFldRowId which should identify whether the field is used as a key, but it doesn't seem to work. I'm currently reading off an Access database.Does anyone have any insight in being able to identify key fields within a recordset?
I have set up my database with 4 fields (num1, num2, num3, sum), and have created a form with 3 fields to insert 3 numbers. That part is easy.My problem is when i submit these 3 numbers (5, 7, 6) i want the form/script to add these numbers together and insert it into the 4 field "sum".
I have a database table and I am building a search-like page which is supposed to pull information from the database based on the following. "Get records where field1 is 30% (or more) higher than field2 within a specific time period". Should these records be chosen by the SQL query itself?
Or should I get all the records within the time period using GetRows, and loop through them checking whether or not it fits the criteria? While I certainly feel more capable of the second approach than the first, I am not sure if its the best way when large numbers of rows are involved.
I want to create an order form for prints online... I will have up to 200 prints to be selected. What I am thinking is that I will have an HTML Form that has all the 200 thumbnails with a check box next to them. They select the ones they want and push next. Then I would like it to create a set of options for each one they selected.
That basically says the image name then has a check box for 5x7, 8x10 and a text box for the amount for each... I do I create the page what creates these selections and how to I incorporate that into a mail form going to the next page?... it seems like a simple enough idea. Am wondering how the reality of it will be.
I have a loads of records in an Access database relating to publications. The publications come in 3 forms, pdf, Word or .htm so I have fields for each called PDFurl, Wordurl and Publink. What I want to do is, if any of those fields contain a value then display an appropriate icon (which will link to the publication).
I'm ok with the latter part but how do I determine if any of the fields have a value and if so display the relevant icon? Rather than do a load of if then statements I was wondering is there a quicker way of doing this, perhaps using a Case?
how would you join the two felds from a table in the database so it can show the image from joining the two fields to know wherethe image is coming from Quote: <img src="<%=(rs_lprojects.Fields.Item("image_folder_path").Value)%><%=(rs_lprojects.Fields.Item("image_src1").Value)%>" />
I have been writing out the general steps I want to do in plain english before writing ASP. The values come from a customised data grid (not in .NET) that is generated according to what fields need to be recorded for that record. What I want to try and do is as follows: - Read form fields into input array (skip first three values : savevalues, userid, productcode) - Save last value of every row (add to quantity for extra info) - rest of processing Is the first one even possible using plain ASP? I remember being able to do it using Javascript, but I couldn't get it to work properly. I have tried to use Arrays in ASP before, but without much success.
is there a way to write a insert statment with out typing out all of my field names? i want to do an insert in every field but i don't want to have to write them all out.
is it possible to copy the value from fields in form1 to fields in form2 without submit the form??form1 and form2 are in the same page. if it's possible hoe to do that??
I have an ASP web form that I want to populate fields based on the first field choice. Example I have 4 fields item, price, delivery, availability. I have all these items setup in an access table. When a user chooses an option from the item drop down, the price, delivery, availability will then populate. I have already made my connection to the database, and created the drop down for field one from the choices. How do I now populate the corresponding fields.
I created a script which suppose to sort on 2 fields. Everything works fine with no errors except when I click on the field that suppose to sort the data it does nothing.
This is the code: Created on test table name Reports2 3 fields id, r_date, r_doc_title