Addition (Sum) Of Column Data
I am trying to build the code that will add a specific column's column where something = something
Example
ID Name Amount
1 Bill 10.00
3 Ted 15.00
1 Bill 25.00
1 Bill 35.00
4 Jude 5.00
In basic word terms, this will describe what I am seeking:
SUM(amount column where ID = 1) ..... answer would be 70.00
I am already connected to the database and can pull out one specific field in a column, just can not add that column.
View Replies
ADVERTISEMENT
I've got some bizarre behavior going on with my ASP code below. For
some strange reason (and I'm a newbie to ASP so it's probably obvious
to others) I can't display all the rows of data from the query. As an
example, the Problem Solution column doesn't display and unless I
comment out another column. Or if I move Problem Solution and it make
ithe first column, then the Root Cause won't display. Code:
View Replies
View Related
how can i show data column wise from database in asp
for example i have data like some names that i want to show like this format
Name1 Name2 Name3
Name4 Name5 Name6
Name7 Name8 Name9
....... ...... .......
please tell me how can i do this
View Replies
View Related
how can i show data column wise from database in asp. for example i have data like some names that i want to show like this format:
Name1 Name2 Name3
Name4 Name5 Name6
Name7 Name8 Name9
View Replies
View Related
I have a 3 page set that searches a database for users, displays the user information in a form and updates the data in the database. The first 2 pages work fine, the third page doesn't. What is annoying is that these pages are a copy of another set of pages that edit news articles (basically the same thing) and they work perfectly.
This is ASP with SQL and VB Script.
Quote: Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E07)
[Microsoft][ODBC SQL Server Driver][SQL Server]Syntax error converting the varchar value '6, 6' to a column of data type int.
/d1intranet/useredited.asp, line 72
So this message is saying that it is unable to UPDATE the field 'UserName' (which has data type INT) with the variable in the SQL code which is default as VARCHAR. Here is line 72: Code:
View Replies
View Related
i cant open any project in ASP.Net and neither can a create a new one
View Replies
View Related
I have two strings that instead of adding them together to get the sum the are concatenating together.Does anyone know how I can get these two to add
while not rstemp4.eof
vservdate = rstemp4("servdate")
vdesc = rstemp4("desc")
vservhours2 = rstemp4("servhours")
vtravelhours = rstemp4("travelhours")
vtech = rstemp4("tech")
shvar = shvar + rstemp4("servhours")
thvar = thvar + rstemp4("travelhours")
rstemp4.movenext
wend
View Replies
View Related
I am trying to add the values of a form. The results keep getting treated as a string and not an integer. So with :
theForm1 = Request.Form("number1")
theForm2= Request.Form("number2")
thetotal = theForm1 + theForm2
Response.Write(thetotal)
If the value of theForm1 is 4 and the value of theForm2 is 5, thetotal is 45, instead of 9.
View Replies
View Related
how to add two numbers from two different textboxes and display it in the third box.
View Replies
View Related
The problem i am having is adding 2 rs values to each other to come up with an amount.
so i have something like the following:
sql1 = "select sum(col1 + col2 + col3) as result1 from table where col4 = "y" "
set RS1 = Conn.Execute(SQL1)
pastdue1 = formatnumber(rs1("result2"))
sql2 = "select sum(col1 + col2 + col3) as result2 from table2 where col4 = "y" "
set RS2 = Conn.Execute(SQL1)
pastdue2 = formatnumber(rs2("result2"))
pastduefinal = (pastdue1 + pastdue2)
But when i do a response.write (pastduefinal) i get "0.000.00"
Does anyone have any idea? I replaced the formatnumber with formatcurrency but still didnt work. Am I using the addition incorrect?
View Replies
View Related
I have a database with three feilds
Tbl_counter
ID
NAme
Count
Evertime the user clicks on a button in the asp page. I want to subtract on from their Count feild and then reinsert that value back into the database as ther new count value.
View Replies
View Related
<%
dim n, c, t
n = request("number")
c = request("cost")
t = c+n
%>
This code returns 43 for c=4, n=3 instead of the sum 7. Do I need any thing else?
View Replies
View Related
I presume it simply does not hold the variables?
On selection (could just as easily be a text field) I want to do two thing.
1) See how many times the script is run, after 5 attempts go to next page.
2) When a number is selected/typed in it should be added to the previous number
Basically I want to stop the page at either a number of loops if it reaches 5 or when the total summing of numbers equals say 4. Code:
View Replies
View Related
Can I add two request objects?
View Replies
View Related
I have 2 radio buttons, Yes and No. I have a text box with a value entered by the user. If the user selects the Yes radio button, I need to add 339 to the value they entered. They will submit the form to add the value...but the problem I am getting is, it keeps adding 339 more than once. If there is also a way...where they select yes and submit and go back to no...to set the value back to the value they entered.
How can I add 339 to a value the user entered without continuing to add 339 if the form is submitted multiple times?
View Replies
View Related
A starting price grabbed from querystring is shown to begin with. Then the options are shown(prices next to them) with checkbox(populated with over 90 options) and the user selects the options and a new total comes up upon submit. So the total of the options is a subtotal and the home and options together is the grand total. Code:
View Replies
View Related
I have current date and iam getting by GETDATE() function. Now i would like to add coming 12 business days in this date. e.g ( today is 1st Feb and if i add 12 business days in this date then the date i will get 17th Feb).
how to do it. I know there are some functions in SQL server which can be used to get the business days. Please some one tell me how is it possible.
View Replies
View Related
below is the code which is used for adding items and then displays the item
which is working fine i have a problem when i display the item if the user press f5 or does refresh it increases the qty.
so if u look at the code i get the product details from a earlier page if the qty which i get is 2 and then i do a refresh on the page the qty becomes 4 is there any way to stop it Code:
View Replies
View Related
I want MS Access 2000 database column of table 1 = column of table 2. This is what I was doing: Code:
View Replies
View Related
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
View Replies
View Related
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 Related
How 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?
View Replies
View Related
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:
View Replies
View Related
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 Related
I 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 ?
View Replies
View Related
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 Related
Pretty 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.
View Replies
View Related
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 Related
If 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
View Replies
View Related
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:
View Replies
View Related
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 Related
I 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
View Replies
View Related
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?
View Replies
View Related