I've tried lots of different ways to reach the total but failed every time. I want to subtract the retail price from the discount price using a fixed percentage. Is this possible?
need to subtract one date from another to show how long a user was logger in for. i.e.
<%=(rsDriverLogin.Fields.Item("OFF_DATE").Value)%> minus <%=(rsDriverLogin.Fields.Item("ON_DATE").Value)%>
The values in the sql OFF_DATE and ON_DATE fields are stored as 13/06/2006 19:01:28 . Can either be done on the ASP page or in the db itself, doesn't matter which.
I need to be able to subtract the total quantity of a product when someone places an order. I'm trying to get my head around this; what's the strategy for doing something like this?
ASP SQL
So let's say I have a "Thank You" page at the end of the purchase. I have a table with a list of product Ids and a column of quantities left.
If I understand your post, I'm picturing this being a stored procedure that looks at the total quantities from my table that contains all the product quantities. Let's say product 1a has a quantity of 5 and product 2a has a quantity of 6.
A bit fuzzy here but what would a stored procedure look like that is able to update and step through all the items that were purchased?
I need to be able to do an SQL update on this table to subtract 1 from the product_quantity field.I could do this with two SQL queries (SELECT product_quantity, then subtract 1, then UPDATE table) but I'm sure there must be a way just to run one query which subtracts 1 from the field. how to do this?
I wrote a survey script but I had problem with the percentage.If 5 persons answers to a question YES and 3 answered NO, how can I get the percentage of each answer (YES & NO)?
I've always been looking for the best way to get an accurate percentage statistics.
For example, in a election scenario:
Person A gets 33 votes Person B gets 33 votes Person C gets 34 votes Person D gets 35 votes
Total votes = 33 + 33 + 34 + 35 = 135 Percent for A = 0.244.... = 0.24 = 24% Percent for B = 0.244... = 0.24 = 24% Percent for C = 0.251... = 0.25 = 25% Percent for D = 0.259... = 0.26 = 26%
Then add up the percentage values: 24 + 24 + 25 + 26 = 99 (where it should be 100)
So, does anybody have a way to get around this problem? How should I calculate the percentage for each person so that the percentage will add up to 100 in the end?
Our store software currently displays the total amount saved (the list price minus our price) for every product using the code below:
'Calculate "YouSave" If Product_ListPrice > 0 Then Product_YouSave = Product_ListPrice - Product_LowestPrice End If
I, however, would like to also diplay the percentage saved next to the amount saved. I tried using the code below but it won't work. Can someone help me out?
'Calculate "YouSavePercent" If Product_ListPrice > 0 Then Product_YouSavePercent = ((1 - (Product_LowestPrice / Product_ListPrice) * 100) End If
I have a recordset iterating through and dumping out to the screen a series of percentages, using the precision 5 and numericscale 2 etc.
When I dump them to the page some of the number are missing a trailing zero - ie, 4.7
What I would very much like to do is add this back on - is there an easy way to format this with a huge load of If...Then's to produce the same affect?
I have to calculate the percentage of an X amount depending on the Quarter of the year. It's driving me crazy, I can't figure out how to do it. Am I missing something. If someone registers the 1st quarter then the price is the full 1200. f the registration occurs the 2nd Quarter, then it is 25% less that rthe full amount. The 3rd is 50% less and the 4th is 75% less.
the amount is 1200 the Quarters of the year = 4 The regristrant is 1
Well my goal is simple. On my site we show "You save: $**.**" but I want that to say "You save: $**.** (**%)."
The database for our store stores the list price, and our price. The store calculates the you save price... so it should be easy to calculate the saved percentage as well. Here's the code that calculates up the "You save" currently on our website: Code: