Adding Values From Records
I want to add intQuantity of all records that have the same prodID. I have tried all sort of variations but I don't seem to get it. I would imagine that it must be simple, that's why I can't get it.
SELECT SUM ( intQuantity) AS ItemTotal
FROM tblOrders
WHERE prodID = ? no clue
Or can I do that in ASP? doing something like (my example doen't work)
<%= (rsOrders("intQuantity") + rsOrders("intQuantity")) %>
in the mean time I'll be looking around for an answer to my lack of know how.
View Replies
ADVERTISEMENT
i have a page that enters numbers stored in different values e.g monday tuesday wednesday thursday friday into a database. is it possible in asp to add those values up and store the added up value in a seperate field in the database
bascially
total =monday+tuesday+wednesday+thursday+friday
How would i do that in asp.
View Replies
View Related
i am trying to add to values togher but each time i try it dont work.
for example
when i try to add 7 and 3 i get 73 and not i want what is 10
i am using the below code
money=RS2("bank")
RS2("bank")=money + pay
response.Write("money="&rs2("bank"))
The DB code is fine as it is recording and pulling the data of te Database but i cant add them up only togher.
View Replies
View Related
I have a table with 2 fields, name and value
I need to be able to add multiple records quickly, for example I need to add
name value
abc 1
abc 2
abc 3
abc 4
abc 5
abc 6
etc etc, does each record have to be added separately, or is there a way I
can add a chosen number of records, lets say 10, and have the value field
increase by one each time?
sometimes I might have 30+ simple records that need adding quickly, and each
time the first records value will be one, and each record after will
increase by one, is there a way to solve this problem or does each record
have to be added separately?
View Replies
View Related
I have a drop down which has numbers from 1 to 25
When a user selects 3 he will see 3 first name textboxes and 3 last name textboxes
the user fills them out and hits the submit button
three records are added to the table
i have a for loop for adding records
Here is my code:
View Replies
View Related
Just when you think something is working, suddenly something new comes along.this is my situation: I want to add intQuantity of all records that have the same prodID. I have tried all sort of variations but I don't seem to get it. I would imagine that it must be simple, that's why I can't get it.
SELECT SUM ( intQuantity) AS ItemTotal
FROM tblOrders
WHERE prodID = ? no clue
Or can I do that in ASP? doing something like (my example doen't work)
<%= (rsOrders("intQuantity") + rsOrders("intQuantity")) %>
in the mean time I'll be looking around for an answer to my lack of know how.
View Replies
View Related
I am trying to create a 'build a quote' page in which a user can checkoff checkboxes and have the total add up once the submit button is clicked. An example of the code I am using is
<form action="add.asp" method="POST">
option 1 value is 5<input name=""check"" type="checkbox" value="5"><br>
option 2 value is 9<input name=""check"" type="checkbox" value="9"><br>
option 3 value is 1<input name=""check"" type="checkbox" value="1"><br>
option 4 value is 2<input name=""check"" type="checkbox" value="2"><BR><BR>
<input name=""Submit"" type="submit"> <input type="reset" value="Reset">
</form>
<hr>
<%
arrB = Request.Form("check")
arrA = split(Request.Form("check"), ", ")
If arrB<>"" then
For each x in arrA
total = x
next
response.write(total)
end if
%>
View Replies
View Related
I was hoping that someone could help me in getting the sum of a column(item_amount). The table is populated through a repeating loop with information pulled from a database. Code:
View Replies
View Related
I have searched the forums and can't seem to find out how to do this. I have a set of values in a column in a database, I want to add all those values up then display them.
View Replies
View Related
I have 2 pages - form.asp and result.asp. in form.asp, i have multiple checkboxes with varying values, like:
<html>
<body>
<form action="result.asp" method="get" name="form">
Name1: <input type="checkbox" name="1" value="5">
Name2: <input type="checkbox" name="12" value="7">
Name3: <input type="checkbox" name="12" value="9">
Name4: <input type="checkbox" name="12" value="11">
<input type="submit" name="submit">
</form>
</html>
I seek to capture these values and add them up in the result.asp page. e.g. if name1 and name3 are selected, i want the total of 14 to be shown up in result.asp page. I need help here for the asp code for the above. Or, may be some advice on how the above can be accomplished.
View Replies
View Related
I am trying to add entries in a database together and place the summed value into a text box. Like a total ordered type function for an ecommerce site. I have a field called ArmChairs in my database and based on how many people buy them, I want to know how many I need to have shipped.
I am really struggling with this last bit and would be really appreciative if someone has some code examples.
View Replies
View Related
I have loop displaying certain records depending on an id number in my sql database. What i need to do using asp is total all the numbers in one of the fields and display that as a response.write.
View Replies
View Related
I may have made a typo somewhere. I am trying to delete collections from RelProdCollection Table that has a certain record with Product ID number of __ and then readd them based on the user's choices on the edit form. Code:
View Replies
View Related
I am trying to total the value of some form fields I am referecing the form
field with an inner loop, I am having a little trouble because the amount of
fields returned is always different, how can I roll-up the total of the form
fields (request.form("subtotal_"& i)) to get one final figure? Code:
View Replies
View Related
I have the following snipet that I want to add two values from a recordset together.
sLoss = the running total for all records. totLoss = the total for this particular record.
PHP Code:
sLoss = sLoss + rs.fields.getValue("sLOSS") + rs2.fields.getValue("LOSS")
totLoss = rs.fields.getValue("sLOSS") + rs2.fields.getValue("LOSS")
Response.write totLoss
I keep getting the following error: PHP Code:
Microsoft VBScript runtime error '800a000d'
Type mismatch: '[string: ""]'
/asp/report/cost.asp, line 527
How come I am having trouble adding these values?
View Replies
View Related
I have a data base that I wish to add a record to. I have many fields to ender, but I was testing my code with just one and it works just fine : Code:
View Replies
View Related
I'm writing a database admin page in ASP. I had it adding records correctly. Then I added an autonumber field ("ID") to the table, and it stopped working. The sql I'm using is Code:
View Replies
View Related
SQL 2000 database with ASP
I've found many things "out there" regarding updating and deleting
multiple records with checkboxes but I can't seem to find anything
about adding them. A user wants to create a price list for their
client and they need to add parts to it in a separate table. I would
like to display the list of parts and the user would select multiple
parts to add to a price list by checking a checkbox and submitting the
form. Code:
View Replies
View Related
There is something wrong with the adding code. It will add sometimes. It's a large database where I have to add records to multiple tables.
The products table doesn't work correctly. Maybe there's a typo somewhere that I don't notice. Please look at the bolded part of my code and see if you can catch something. Code:
View Replies
View Related
i have an instance where I need to add records to 2 different tables. i know how to do it basically, but the problem is, one table is generating a key number and i need this number for the second table records.
how do i put the appropriate records into the first table, grab the id number and insert the records into the second number? the information is coming from a form. i'm developing in an access db but will be moving this to an ms sql db before it goes live.is there a stored procedure that might make this easier? i know nothing about stored procedures.
View Replies
View Related
Can I do the following things in the global.asa file?
When sessions starts:
Add a record into my database
When session ends:
delete it where rs("sessionid") = Session.SessionID...
?
I'm pretty sure I can, but...I've heard not ALL things can be done in global.asa...
Do I create an object, and a connection? How would I do it? Since I want a database in MY database, not in memory like I've seen...
View Replies
View Related
I've writen the code below which displays a drop down select menu and can be displayed by writing the variable 'sjobs'. The code works fine as it is and the menu is populated with the requested info from the database ok. The problem I'm having is adding url links to the menu values. Code:
View Replies
View Related
I got an asp page that supposed to add,delete records from access 2000 mdb file. It loads all the records but when i try to delete or update i get these errrors. Code:
View Replies
View Related
I have a form that uses Code:
<select name=player_id multiple>
<option player_id="<%=player_id%>"><%=FName%> <%=LName%></option>
</select>
To create a drop down selection list. What I want to send to a table is FName and LName instead of the ID. Any hints on how to do this.
View Replies
View Related
With ASP, how can I automatically add records to a database with an excel file residing on the user's machine? Assuming the excel file has the same field names/datatypes/order as my database table's fields.
View Replies
View Related
I have got an access database with 100's of records in it(each record is just one word/phrase)...i am looking to develop some asp code that will select all distinct values in that table and list the number of times that text appears.
For example in the table contains the following records: -
banana
apple
orange
apple
apple
orange
apple
I want the following output: -
apple - 4
orange - 2
banana -1
View Replies
View Related
I have buil a app that records types of transactions.
Each transaction has a specific type and also a DATETIME value attached.
I can display and work out calculations on all the data but I do not know who to sperate this into doing calculations for the previous days, week, month ext..
This is where I really need your help.
Can you please instruct me in how to do this, what im thinking is where the user can enter or select the days date thay want to look at and then this quiries the informatio where the date is within this critetra. (the same for week or month also)
Another problem for this is how can I have a something on the page which automatically tells it look at yesturday only, how does the computer know what yesturday will be, will the user need to enter yesturdays date in a specific format?
ANY HELP WOULD BE REALLY GREATFUL as I have a short time to put this historic information viewer togther.
View Replies
View Related
I was wondering if you could help me with the following problem. I have 2 listboxes in my
webpage, 1 has cities, and the other lists the streets of the city from the first listbox.
When I click on a city, I want the 2nd listbox to populate with all streets in the city. The city and streets are saved in a database, so when the user selects the city, I will run a query on the database and populate the 2nd listbox with all streets.
How can I do this with normal ASP? I know how to do this with ASP.NET, but don't know how to activate this with normal ASP?
View Replies
View Related
The problem concerns 2 tables, cart_products and cart_shoppingcart.
Cart_products contains all the product data (eg, prices, product's key name, etc), but most importantly, it contains the quantity of stock (prod_quantity) for each item.
cart_shoppingcart contains all of the user's items in their shoppingcart, including those that are part of an (customer) order; these have the order_number to differentiate from those that aren't in any order (their Order_number is 'no_order', the others have the order number).
Now, what I want to do is this:
For every item in the order (ie, every entry in cart_shoppingcart that matches the username and order number), take the quantity (x) the customer is ordering, then take the quantity of stock remaining (y), then subtract x from y to create the new stock level (z) and update the appropriate record in cart_products with z (all this with SQl preferably).
I was thinking of using a Do while loop, but realised that it wouldn't work as I'd have to use several SQL statements and then I'd run into a problem the minute ASP reads "objrec.movenext".
View Replies
View Related
I'm trying to pull the last 5 records from my database.
<% j=5
rs.MoveLast
While ((j>0) AND (NOT rs_article.BOF))%>
''Execute HTML and data insertion here
<%rs_article.MovePrevious
j=j-1
Wend%>
Everytime I attempt to run this code, I recieve an HTTP 500- Internal Server Error. It tells me no more than that. I know that my connection settings are OK because when I move forward through the database (first five records), the code executes without error. And yes, my Cursor type is Dynamic.
Alternatively, I would also like to know how to add new recordset to the beginning of a database rather than the end.
View Replies
View Related
I want to call a recordset so you can edit the details and then obviously pass the parameters onwards into the db. However, the user guide just says this:
To process other fields in the form, use the Form collection of the upload object the same way you would use the Form collection of the Request object. For example, if your form had a text element named UserName, your processing code would include: Code:
View Replies
View Related
i need to convert the escape values which are by mistake updated in DB.
example:
this is a sample text string
is updated in DB as
this%20is%20a%20sample%20text%20string
here %20 is the space.
like wise there are many entries for :,'
is there way that i can update all this in a update statement?
or use asp to to update the records?
View Replies
View Related
I have a variable SET which has the value Of 1, 2, 3, .., N.
SET=val1, val2, val3, val4, ..., valN
What is the commend or procedure to extract individual values, val1, val2, ...
View Replies
View Related