How To Do Addition Using 2 RS Values?

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


ADVERTISEMENT

Addition

i cant open any project in ASP.Net and neither can a create a new one

View Replies View Related

Addition In ASP

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

Addition

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

Addition Of Two Numbers

how to add two numbers from two different textboxes and display it in the third box.

View Replies View Related

Addition And Subtraction In SQL

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

ASP Addition Code

<%
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

1 Plus 1 = 1? Holding Variable For Addition

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

Request Objects Addition

Can I add two request objects?

View Replies View Related

Radio Buttons And Addition

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

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 View Related

Addition In Populated Checkboxes

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

GetDate() And Bussiness Days Addition

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

Page Refresh Causing Addition

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

Form Values With A File - Passing Values

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

How To Convert Escape Values In To Actual Values

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

How To Extract Indiviual Values From A Set Of Values

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

Get Values

I have to get values from table using arrays can anyone tell me how this can be done here is my code

Code:

For i = LBound(arrCart, 2) to UBound(arrCart, 2)

Set rssubcat = Server.CreateObject("ADODB.Recordset")
strprod="select Member_Price from Products_Price where Products_Price.Product_Id= '" & arrCart(cartProduct_Id,i)"'"
rssubcat.Open strsubcat, Conn

total=rssubcat("Member_Price") * int(arrCart(cartQty, i))
subtotal=subtotal+ total

Next

View Replies View Related

Cannot Get The Values

I have a main data entry form which has a link to a detailed data entry form. The value of the link in the main form is the sum total of all the line items in the detailed form. The detailed form has fields to capture the individual line items like contracted service expense, travel expense etc. I am capturing the total of individual line items using session variables so that when the values of the main form is saved these total of line item values get saved. However, if one gets to the mainform via login and tries to resave the values (which is already saved), the above session variables (from the detailed form that contains the sum of line items) get null values. However, just navigating to the detailed form through the link and coming back to the main form sets the value in the session variables.My question is how to get the session variable values without having to go to the detailed form and come back to the main

View Replies View Related

Values

if it is possable in ASP i could store a value in one ASP page and look at it on anouther ASP page. for example:

On a login page i want that page to store a value called rights that is a number. when it goes to any of the other pages EG add user, Delete users if the user does not have the needed rights to takes it back to the main screen.

View Replies View Related

Get And Set Values

I wish to get and set values on child controls on a formview.For example. Changing the text in textbox. Hiding or unhiding child controls based on user. Replacing a blank with a default or calculated value that will need to be generated at runtime.It seems as though this should be thoroughly documented, but I'm not finding much.

View Replies View Related

Add 3 Values

i need to know if i have a loop that outputs values for each month how do i get it to add the values and only display them every 3 months,(every quarter)?

jan
123
feb
234
mar
432
first Q
789<---------how do i do this?
Apr
125
may
548
jun
323
second Q
So on..

View Replies View Related

Two Different Values

Is this possible. I have a drop down menu.

<select name="dd1" onChange="somefunction(this)">
<option value="<%=rs("Image")%>" > <%=rs("Iname")%> </option>
</select>

I need to use the value=rs("image") in a javascript function, but i need the selected value of rs("iname") in an ASP array. Request.form("dd1") will always give me the value of rs("image"). Is there any way around this?

View Replies View Related

Get All The Values

How can I get all the values of the previous form without having to hardcode the the names of the all the form elements? Something like:

Form Element Name: Form Element Value.

View Replies View Related

URL Values

I want to pass the value of a variable through a form to another page URL

[CODE]
<form name="form" method="post" action="AgentReceipt.asp?date=" & strDateStamp>

<p>Date Stamp: <input type="text" name="datestamp" value="<% =strDateStamp %>"
[CODE]

I do not get the value of strDateStamp on the URL of the other page.

View Replies View Related

Values From SQL

Using a query statement, I am trying to add values into the textbox of an ASP page to enable users to edit it. But it only displays the first word of the record. The rest of it gets chopped off. Code:

<P>Company Name:<INPUT NAME ="CompanyName" style="WIDTH: 371px; HEIGHT: 22px" size=47 Value=<%=objRec.Fields("company_name")%>></P>

The value in the textbox only shows R1 when the value in the SQL database is R1 International Pte Ltd. The datatype in SQL is char if it makes any diff.

View Replies View Related

Same Values

i have a ASP search page, and when i go to submit the search and the page refreshes, id like the search box to still have the same value.

View Replies View Related

Passing Values

Is there a code, or something that scrambles the value being passed fromone asp page to another??

what I mean is this:

if i want to pass a value from a database (record id #721) from my page records.asp to recordview.asp

it might appear like this in the browser window, or when u highlight the link on records.asp:

recordsview.asp?K=751

I don't want users to see exactly what record number is being access... so I'd like it to show some garbage in the browser like

recordsview.asp?@$@#$=DSFSD+jklsjkld

you get my drift...

View Replies View Related

Getting Values From Array

for i = 2 to NOD
newdate = DateAdd("d", 1, newdate)
strdate = strdate & newdate & ", "
next
MyArray = split(strdate, ", ")

I have the above code written in one of my asp pages, the date array is splitted, but how do I get the first and last date assign to a variable.....

int min = MyArray(MyArray.Length-1)
int max = MyArray(0)

I got this code from the web, however it gives me an error:

Code:

Microsoft VBScript runtime error '800a01a8'
Object required: 'MyArray'

View Replies View Related

Getting Javascript Values Into ASP?

1) User selects something from an ASP generated list

2) Javascript then populates a nearby div with the text from this list

HTML/ASP: Code:

View Replies View Related

Drop Down Values

I am facing with a problem of getting Drop Down Values. How do I get Drop Down Values in a array.e.g,

On Submit, I hv to display records based on similar MergeIDs,
Like, e.g for MergeID - 1001 i have 2 records in database
So I will hv to display those two rows in a concatened form.
But these two records hv different IDs.

ASP Display
DropDown MergeID Username Task ID
3 1001 Ashish,Kamal Design,Test 21,22
5 1002 Sunil,Anil Data,Design 25,26

Now, when I Select 3 and 5 in drop down,I want that for MergeID it should show DD value as 3 and for MergeID 1002 as 5.I am not getting that.I am able to get IDs 21,22 in an array.

View Replies View Related

Not Getting Form Values

I have the following line of code in my asp page:

Dim ix
For ix = 1 to Request.Form.Count
fieldName = Request.Form.Key(ix)
fieldValue = Request.Form.Item(ix)
Response.Write fieldName
Response.Write fieldValue &
Next
Response.End

It is not returning the results of any field on the previous form page.
Does anyone know what I might look for?

View Replies View Related

Persistent Values?

I'm a (moderate) newbie to and I'm building an ASP/VB db-driven site where the user selects a brand from a menu, this determines the contents for another menu with models. Selecting a model displays details about that model. Nothing too original here Its a small low traffic site with no ecommerce elements - just window shopping.

My questions is : I need to know on all pages what the current brand and model are (and modify these when the user changes them).

From what I understand there are 3 (?) methods: server vars, session vars or hidden fields. Which should I use for this purpose and can anyone point me to some good related examples/tutorials? (I've read the stuff on this site of course).

View Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved