Calculating Database Fields
At the moment in time I have a product database being displayed. I could do with including another column to the database which allows me to enter a specific quantity for that product line. All the quantitys fields need to be calculated to their specific product cost value.
Finally all the sub totals need to be calculated together to give a grand total, which will be displayed on another page.
View Replies
ADVERTISEMENT
Let's say I have an Access DB with a table named proCount. In the table proCount, I have two fields named numOne and numTwo. In my ASP page I'd like to have a repeating region that lists all the records in the proCount table. Is there a way to have ASP calculate the sum of all the returned records for the field numOne and the field numTwo?
View Replies
View Related
I am looking for an ASP script that let me to serach all database contents with only one textfield in search page. eg: I have a database with five columns for lessons: Mat, physics, geography, history and sport. Each field have numbers 1 thr 5. I want to search only those students have number eg:3. with entering the number in textfield in serach page. I have no problem in result page.
View Replies
View Related
Is their a way to check with asp-code if a database field is relational with another field (from another table)?
For example:
If fieldname = relational Then...
End If
View Replies
View Related
I'm trying to set up a quick if/then/else statement for when the database field returns no results. I'm not getting an error but when the field is EMPTY it still executes the ELSE statement.
<%
If rsOffice("FloorPlan") = Empty Then
Response.Write ("Not Available")
Else
Response.Write ("<a href=" _
& rsOffice("FloorPlan") _
& ">View</a>")
End If
%>
View Replies
View Related
how to compare one Database field against another which both have a date and time in them (DateTime format) using VB in WebMatrix. or just comparing Database fields of DateTime aginst each other in VB.
View Replies
View Related
i have a form with fields that contain data from a db. the fields can then be edited, and on the click of the "submit" button, the updated information is returned to the database, replacing the old. a bonus would be arrow buttons allowing navigation from one record to the next, with the information populating the form each time. i'm having a hard time with this.
View Replies
View Related
I'm trying to retrieve information from a field in a database, which contains data, some of which are the same. ex:
let's say the table is called "Person_info" and there are 5 rows of info with a different person's info.
let's say i want to display the info in the fields called "City" but there are duplicates ex:
Toronto
Vancouver
Toronto
New York
Atlanta
I'd like it to display all the cities in there on a web page, but, I don't want it to display the same city twice:
so it'll display this:
Toronto
Vancouver
New York
Atlanta
I just can't get it to work? it keeps displaying duplicates.
View Replies
View Related
This code has worked in the past on this same page, and for some reason it doesn't want to calculate the numbers anymore. Anyone see anything that is out of whack?
Basically I am taking the input numbers for each field and adding them up on one column, then taking the totals of all of those columns and adding it up to display as an overall total. Code:
View Replies
View Related
How can I specify formatting restrictions for special fields like Postal Code
(format X1X 2C2) or date input field MM/DD/YYYY? I have Acces DB with these specs, but when I used FP2002 Database Interface Wizard, it ignores these. Also I am unable to "edit" any of the records utilizing pages generated by this wizard.
There is an error that it will not accept empty fields. I have no problem adding data (even if some fields are empty) or deleting records.
View Replies
View Related
I am using a repeated field to bring in to my page repeated records, and I have been able to retrieve values that are entered into text boxes that are associated with these repeated fields. I would like to post these values into a database, but I'm not sure how to set up my table as I know that each employee's values as well as number of fields will be different.
I thought about setting up two tables. One that houses the dynamic question and the other to house the answers, but I'm not sure if that will work. I could really use help as to the syntax to write a loop statement that will insert my returned variables and create the field names dynamically into my database table. I believe this is what i need to do.
View Replies
View Related
I have a an issue that I would love to solve. The below code adds 111111111111111111 to the field when I want it to sum the amount which in this case totals 18 and then add that total (18) to the field! Code:
View Replies
View Related
I am currently working on a document management system for my company's Marketing department. They wish to be able to upload files to the server.
Rather than deal with the many permissions issues we have had in the past with saving and deleting these files to the server's file system, this time we are trying to use SQL server BLOB fields to store the files.
The premise is simple -- a user clicks on the link and the file is then shown in the browser. The documents are mostly word, Quark, and Adobe Illustrator documents. I was thinking the code would go something like this: Code:
View Replies
View Related
I have announcements down the left hand column of a site and want to display contact info if it is available - if it is entered into the database. So I only want to display a space plus the data if there is data in the field. Code:
View Replies
View Related
I don't know how to upload word doc, images and other files into Oracle Blob fields with binary format.
I tried with the following code, normally it's inserting, suppose if i try to convery binary. Code:
View Replies
View Related
I have a form setup to search for people between CageT1 and CageT2 but am unable to get it to work. Peoples birthdates are stored in Access in m_date_of_birth; age is not stored in the database. The code below is a test.asp page I created so that I could debug the problem; thats why all this page requests is a Response.Write(sql). Code:
View Replies
View Related
I'm having difficulty calculating vat 917.5%). I've written some basic asp to do this, but the result is far from correct. Can anyone spot what I've done wrong ?
<%
Session("price") = (Session("variable1"))+(Session("variable2"))+(Session("variable3"))
%>
<%
vat = Session("price") / 100 * 17.5
Session("total") = Session("pprice") + vat
Session("total") = FormatNumber(Session("total"), 2)
%>
For example, if my variables are:
variable1 = 165
variable2 = 50
variable3 = 25
When I write the session variable 'total' it comes out at: 1,944,654.38
If I run the vat calculation on just on variable, without adding them, the result is correct. So I guess I'm adding sesison variables incorrectly?
View Replies
View Related
Ok so I have 5 variables:
start = "8:00:00 AM"
lunchstart = "12:00:00 PM"
lunchend = "1:00:00 PM"
end = "5:00:00 PM"
totalhours = X
What I want to do Is calculate the total hours between start and end and subtract the total time spent on lunch. For example, using the variables above I have been trying for weeks to figure out how to make total hours = 8
View Replies
View Related
I have set up a variable that if the answer is correct score =1 however im not sure how to total all the scores and i would also like to have it as a percentage. Code:
View Replies
View Related
I have a microsoft access database with one table. I am trying to extract a filtered list of records from the database using ASP. So far i am able to do this. My next step is to somehow calculate the median from this filtered list within ASP. Maybe using some VBscript or something?
View Replies
View Related
I need to get the sum of all fields where clientID = 'woteva'
so far i'm only doing this by bringing them up with the 'move nxt' but this then displays all the fields, where i just want to display the result without all the fields showing aswell? Code:
View Replies
View Related
I know this is more of a maths problem. But I'm not having a good day with it today. what I need to do is work out the percentage of closed job against the total jobs made? So
StrTotalJobs
StrClosedJobs
are the varables. What is the code I need to work it out?
View Replies
View Related
when I calculate a Digits for example: 101.12 * 1.21 the resilt is 122.3552 This one should be 122.36 and if it is 122.3549 to be 122.35 How can I make this thing works?
View Replies
View Related
I have birthdates in a field called CustomFieldDOB in a table called Vendor. The birthdays were entered with mixed formats, m/d/yy, mm/d/yy, m/dd/yy, m/d/yyyy, mm/d/yyyy, m/dd/yyyy, and with separators of / and -.
Total number of entries is 5600+ so manually changing each of these to one format would be VERY time consuming. In the end, I am trying to have our Intranet page show "Today's Birthdays". I am familiar with setting up a loop to display the Vendor names , I just don't know how to calculate variable formatted birthdates.
View Replies
View Related
I need to calculate the number of elapsed minutes between two datetime variables. BUT, it needs to only include times between 8am and 5pm on weekdays.
So if the starting datetime is at 5:01pm, it doesn't start counting until 8am the next weekday morning.
Or, if the ending datetime is at 6:30am, the counting would stop at 5pm the previous weekday.
View Replies
View Related
I am logging a time that people log in, stored as a short time. I want to be able to run a script which runs through my users database and checks all the users who are logged in, it checks the users last action time time against the current time and automatically logs any out any users who haven't had any activity in more than 30 minutes.
pseudo code as follows:
dim currentTime = now()
dim lastActionTime = rs("lastAction")
if(lastActionTime < currentTime - 30 minutes)
log the user out
Can anyone tell me how I code the time calculation to deduct 30 minutes from the current time?
View Replies
View Related
I am trying to modify an existing ASP application that produces forms with several 'blocks' of text that are contained within table cells and which have their own HTML id's.
These blocks must not be split over two pages. Is there a straightforward way of calculating the size of each block/table cell so that the blocks are not split and the form prints on the minimum number of pages? This is an intranet application, so we have a certain amount of control over browser settings, so margin settings etc are not a problem.
View Replies
View Related
I have an array like
array = "1,2,3|,2,4,6| ...)
There will be an unknown number a values between the | and an uknown total number of values. I need to get the average of the number between each of the |'s. Any ideas how to handle that?
View Replies
View Related
if there is a way in ASP, to calculate with of a string of text in pixels. The result is to be used to set table width so that texts don't get wrapped to second line.
View Replies
View Related
I have done a fair amount of coding but very little in the way of maths type stuff
<code>
While Not objRSC.EOF
Response.Write "<tr><td>"
Response.Write objRSc("Item_Quantity") & "</td><td>"
Response.Write objRSc("Stock_item") & "</td><td>"
Response.Write objRSc("Stock_description") & "</td><td>"
Response.Write objRSc("Item_Price") & "</td></tr>"
objRSc.MoveNext
Wend
</code>
What I now want to do is to add all the Item_Prices together, .
View Replies
View Related
I have a problem with returning a value from an external function.....
My asp page is basically a list taken from a database. A date record is written from the DB, then all the recordslinked to that date are listed, then the next date, then the next series of records, i.e. Code:
View Replies
View Related
I need to get the number of seconds when subtracting two date/times.
With the code I am using below I subtract the two date/times and end
up with a total of days like "1.56".
Then when I multiply it to get
the number of seconds I am not getting an accurate number. I should
only have whole numbers of seconds with nothing past the decimal
point. I would like to be able to subtract the two date/times and get
the number of seconds without multiplying to get it. Is this possible?
Does anyone have a better more accurate way to do this? Code:
View Replies
View Related
I have a text field in a web page I am working on that seems to be calculating phone numbers before inserting them into an Access database. i.e., 867-5309 will result as -4442 in the Access text field. My guess is that the webserver or client is processing it before inserting it. Is there any way to stop this other than using a validation script?
View Replies
View Related