Adding Values In A Column
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 RepliesI 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 RepliesI 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 RelatedI've searched high and low in this forum for an answer to this one. maybe someone knows where it's at.
Let's say I have a page that is displaying fields from the database. There is a column of numbers, that at the bottom of the page I would like it to display the total of those numbers displayed. Is there an easy way to make this happen?
I need to count the different values from within a database column. It's a "State" field so I'm trying to find out how many people from CA, from NY, from TX, etc.
I have no problem with the SQL to get the number, my problem is having this number displayed on the ASP page (it doesn't) ... I'm sure I'm missing something so I wanted to run it by here to see if someone could get me on the right path.
What I'm trying to do is list all the States on an ASP page and have a number beside each state representing the total for that state in the database. EG:
NY = 5
CA = 6
TX = 22
etc
Any ideas or suggestions on the best way to do this would be appreciated. I've tried some of the ASP "quick lessons" on the web but haven't really found anything that fits this situation.
Here's the link for the db table:
http://k.domaindlx.com/gemetria/pageing.asp
How do I insert a field of values?
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.
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.
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
%>
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.
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.
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.
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:
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?
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 RelatedI want MS Access 2000 database column of table 1 = column of table 2. This is what I was doing: Code:
View Replies View RelatedI 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:
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?
I have a csv file that I'd like to be able to add a column to. Specifically, I want to take the first 6 chars of the filename and add it to each row as a new column. e.g.
Code:
whatever.csv 'before
1,2,3,4
whatever.csv 'after
1,2,3,4,whatev
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, ...
Ok let me explain what I am trying to do as easily as I can. I have a table in my access database that I am connecting to. I select a specific id number using my SQL statement. Now what I am trying to do is scroll through that records row and get the column name of that column along with the value of that cell. I hope that isn't to confusing. Now I'm not sure whether this would be done using ASP or done in my SQL statement. Code:
View Replies View RelatedHow do you get the description of fields in an Access database? I really need this and can't find it anywhere....
It would also help if someone showed me how to get the datatype and other info (like if it's a Yes/no or True/False field).
What is the resource/doc for this so I know where to look before asking from now on?
Ok i'm self taught with regards to ASP so not great etc, so sorry if this is a really basic question..
On the last line here i'm trying to some how get it to call the last ID entry...
ImageID = Request("ID")
If (Len(ImageID) = 0) then ImageID = "1"
If Not IsNumeric(ImageID) Then ImageID = "1"
If ImageID = "0" then ImageID = "1"
If ImageID>3 then ImageID = max(Len(ImageID))
This is basically for some max min links for a online comic here's what it links to
<a href="default.asp?id=<%=ImageID-1%>">< Backwards</a> -
<a href="default.asp?id=<%=ImageID+1%>">Forward ></a> -
Code:
Can someone please explain to me why the hyperlinked column headings will sort in Firefox and IE 7 but not in IE6. Code:
View Replies View RelatedI need to set up an HTML table or the like, with 4 columns.
Each column needs to have a header with a FRIDAY (dd/mm/yy) date.
i.e. this weeks Fridays date is 16th Feb, the following is 23rd Feb
etc.
So, I need column 1 to be headed 16th Feb, col 2 to show 23rd Feb etc.
As this week passes, the dates need to move up 1 week, so that next
week, col 1 will display 23rd Feb and so on.
These headers need to change according to the date.
Please can you advise how I best achieve this ?
we have a requirement to freeze the column and row column heading... so that when the user scrolls to the right the first two columns ( I refer them as "row headings") will stay and the remaining columns scroll left and when the user scrolls to the bottom the first row stays ("column headings")and the remaining rows will scroll up.. This can be easily accomplished in EXCEL by freezing the itersecting cell... How can the same be accomplished using HTML tables /ASP code.... Is there any Active X control available that can be used to accomplish the same?Our technical env is ASP and Oracle DB
View Replies View RelatedPretty basic but I cannot figure it out.
Column:
FULLNAME (lname, fname)
Needs to be
FNAME
LNAME
Should split at the comman.I already have all the columns created; just
need to SQL command to make it happen.
I am trying to access a table in a SQL server using ADO in ASP. It works fine in the rest of the site. Here is the code:
View Replies View RelatedIf I have several fields:
a | b | c | d | e
and the original SQL = SQL & " ORDER BY a ASC ".
I want to place links to b, c, d, e to make the table of results to show by ascending order of b (or , c, d, e).
do I need to place an "if/ end if" in the sql or do I put some statement in the paging?
example
a (ORDER BY a ASC)| b | c | d | e
1 | 3 | z
2 | 2 | y
3 | 1 | x
4 | 5 | w
5 | 4 | v
to
a | b (ORDER BY b ASC)| c | d | e
3 | 1 | x
2 | 2 | y
1 | 3 | z
5 | 4 | v
4 | 5 | w
I have a SQL query that produces a table which displays account numbers and the amount owed on those accounts.
the page that displays that table is written with ASP. Does anyone know how can I highlight the rows in the table where account numbers have more than 7500 dollars in amount owed? Code:
im reading from multiple databases, and one restraint is that i must know the amount of columns and the names of the columns before i can display info from the database.my question: can i somehow GRAB or READ this information from each database and then just adapt my Display accordingly
View Replies View RelatedI have an asp page which the user enters a time(e.g. 12:21). I need to insert this time into a SQL Server DB, which has a smalldatetime column.
I have tried everything I can think of (such as CDate, TimeValue, FormatDateTime etc) to convert the time string, into a valid time. However, the insert always try to insert a datetime datatype (e.g. 12/12/1899 12:21:00).
I am trying to process the insert through ado, eg:
objRS.AddNew
objRS("Field1") = strText
objRS("DateField") = dteValue
objRS.Update
I use this code to dynamically create a column in a table...
strSQL = "CREATE TABLE (FirstName TEXT(30), LastName TEXT(20));"
conn.execute(strSQL)
This will create two text columns. How can I create some YES/NO columns
instead of TEXT columns?
Is there a way to have a piece of repeating information display in multiple columns like a phone book? I need to display a list of contract numbers which will link to the actual contract.
There is no other information to display and it would be better if I could display 3 or 4 columns on the page like a phone book. Hope that makes sense. I am using Dreamweaver and it's and Access db if that helps.