Calculation Result
Does anyone know how i can make
[code]
Dim excl
excl = rs("price") / 1.175
[code]
return only a 2 decimal place number
Does anyone know how i can make
[code]
Dim excl
excl = rs("price") / 1.175
[code]
return only a 2 decimal place number
it is possible to compare the result of 2 recordset and
filter those similiar results,and display only the remaining results
select distinct c.execno, c.month, c.year, ISNULL((s.shift* 7.17 * l.mainuph),0) AS Capacity, s.shiftdate
from mainline m left outer join custorder c on m.execno = c.execno
left outer join execmaster e on e.execno = c.execno
left outer join model l on e.model = l.model
left outer join mainshift s on s.line = e.line
where l.model = 'gbm 10' and Month(s.shiftdate) = c.month
order by s.shiftdate, c.year, c.month
after i have a join table. the higlighted part, when i put it in my asp page.can i just call out to do some other calculation. maybe that capacity i take it out to do some other calculation? is that possible?
I have got 3 columns in a database table:
S1_Percentage | S2_Percentage | S3_Percentage
Depending on the percentage given, each section gets a pass or fail and there is then a final pass or fail calculated within the page I want to display the information. What I would like to do now is show a sort of traffic light image, green, amber or red depending on which sections are passed:
Green if all sections passed, Amber if any section failed but still achieved a pass mark and Red if the student failed to achieve the overall pass mark. Code:
would like to calculate field based on the entry in another i.e.;
field3 = field2 X field1
field1 field2 field3
10 2.5 25.00( =sum(field1*field2))
How do I go about this in the SQL DB itself, can it be done within field3?
I used ASP and wrote a login / logout program. This is to capture people who comes into my lab from 0800 to 1700.
The data collected are stored in a table
Userid Date_in Time_in Date_out Time_out
123 4/3/2005 0900 4/3/2005 1000
121 4/3/2005 0925 4/3/2005 1100
122 4/3/2005 1200 4/3/2005 1400
127 4/3/2005 1500 4/3/2005 1600
125 4/3/2005 1503 4/3/2005 1630
122 5/3/2005 0800 5/3/2005 0845
The manual way of calculating utilization on 4/3/2005 will be [(Time between 0900 to 1100) + (Time between 1200 to 1400) + (Time between 1500 to 1630)] / (Time between 0800 to 1700) X 100%
The problem is that depending on what time the next person arrives, there might be an overlap in time. For example, A comes at 9am and leaves at 11am. B comes at 9.30am and leaves at 12pm. The total duration will be from 9.00am to 12 pm that is 3 hours instead of (rs("time_out")-rs("time_in")) = (11-9) + (12-9.5) = 4.5 hours
Is there a formula or way to automate this process?
Can i calculate the next month starting day and next month ending date.For example if this is january then i need the next month that is february starting day and february
ending day. I need to calculate the date in that way given below, I
mean without query. Below method is i use it to calculate the todays
date and the end of the day.
MonthLastDay = Empty
dFirstDayNextMonth = DateSerial(CInt(Format(dCurrDate, "yyyy")),
CInt(Format(dCurrDate, "mm")) + 1, 1)
MonthLastDay = DateAdd("d", -1, dFirstDayNextMonth)
i had to calculate the date of birth and current balance of car payments.. tried some calculations but it seems more error msgs i got.
View Replies View RelatedI am using the DateDiff function to compare two dates in a query on a page. I then need to use the "Expression" created from that DateDiff function in a WHERE clause calculation, but it is not working correctly.
The page loads successfully with thre recordset populated, but the WHERE clause has no effect on the data. I'm guessing that I am doing something very wrong, but I have been staring at this for hours with no avail!
CODE:
I've created a form where the form field integer values are added to create and display a total once submitted, but my form is displaying a Mismatch error. Do anyone have any suggestions?
<% dim field1, field2, field3
field1 = request.form("field1")
field2 = request.form("field2")
field3 = request.form("field3")
total = field1*1 + field2*1 + field3*1
%>
<form action="untitled2.asp" method="post">
Field 1: <input type="text" name="field1"><BR><BR>
Field 2: <input type="text" name="field2"><BR><BR>
Field 3: <input type="text" name="field3"><BR><BR>
<input type="Submit" value="Submit">
<br><BR><BR>
<%=total%>
</form>
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
(1200/4)*100 ?????
This is the page where I collect the data in drop-down boxes with values of 1-10 and send it to a submitted page to do calculations.
Example:
Employee1 TeamScore(1-10)
Employee2 TeamScore(1-10)
Employee3 TeamScore(1-10)
Employee4 TeamScore(1-10)
Then I submit this page with all the values in TeamScore for every employee and I want to perform a calculation based on the values in the drop-down and a weighted score from another database table. An example of a weighted score is 0.11 and I need to multiply the value(from 1 to 10) times the weighted score of 0.11 for each employee.
I have several records to update all at once from the previous screen of drop-down boxes containing numbers 1 - 10 and I want to take each individual drop-down value and multiply it by a weighted score (i.e. 0.11 etc.) Code:
I would like to calculate freight online for UPS and Fedex. However I have already calculate freight for ABF, Roadway and MyYellow, because they have provided sufficient documentation of Input/Output parameters. I try to find out Documentation on Fedex and UPS, but did not find any documentation or any sample code for this.
I hope some of the guys already did this excercise, can anyone tell regarding this?
FYI, I have created UPS account and FedEx and same Information I hv asked from them but did not get any reply for them also. Code:
I have the following code:
If ad_expiration_date (date() + 90) then
ad_expiration_date = (date() + 90)
else
end if
What I want to happen is if the ad_expiration_date entered by the user is beyond 90 days from today's date, the Expiration Date should be today's date plus 90 days. If the entered date is less than 90 days from today's date, leave it as entered. The code isn't working correctly, all dates entered are getting converted to today's date plus 90 days.
I have this form where in i calculate the number of months
between 2 dates.It calculates only if both the textboxes have values.
And then i display this in another text box.
The user has to enter the date in DD/MM/YYYY format. user can select
date from calender popup. Apart from selecting the user can also type in
the date.
I am using a function which splits the date entered by the user
into DD MM YYYY and then compares each of these values to see
if its in the valid range like day is between 1-31, month between 1-12
etc.
But i m having a problem. If the user enters characters instead of digits,
my system accepts it in the first box without giving error and then when
the user selects a proper date in 2 textbox its gives an error: 1 is null
or not an object. this error comes at the place where mt function splits
the entire date string into DD MM YYYY.
Could someone please give ne a solution, a way to format the date so that
i let the user enter first 2 digits and then a "/" and then 2 digits and then a
"/" and then 4 digits only.
i need to calculate the time and date difference between two times and dates.
Example 1 works fine:
Difference between 27/09/04 10:00 and 28/09/04 12:00 gives a correct answer of 1 day and 2 hours.
Example 2 gives an error:
Difference between 9/16/04 1:50 PM and 9/28/04 11:54 AM gives an incorrect answer of 12 days -56 minute(s) .
How do i fix this?
I have a database setup and the results come out as
Product 1: Shorts
Size: M
Price: £2.99
Product 2: T-Shirt
Size: XL
Price: £3.99
Total: "TOTAL HERE"
What I need to do is total these up
The Cells are called:
Product
Size
Price
I want to do some checking for my table for eg:
I want to check if the table for which year then if same year then do something.....
i want to have a search application wherein it returns a results page and arranged based on the most relevant word. can you please give me an idea with this or point me to any info.
View Replies View RelatedHow can I assign the result of a SQL-query to an ASP variable? This is what I have so far but it doesn't seem to work. Code:
dim strSQL
strSQL="select TestID FROM TestID_Description WHERE CL1='" &Request.Form("CL1")& "' AND CL2='" &Request.Form("CL2")& "'AND CL3='" &Request.Form("CL3")& "'AND CL4='" &Request.Form("CL4")& "'AND CL5='" &Request.Form("CL5")& "'AND CL6='" &Request.Form("CL6")& "'"
objRS("TC_Number")=objConn.execute(strSQL)
Maybe it's interesting to know that TC_Number is the primary key of the table.
The delete method of the FileSystemObject.FileObject does not return a result. If permissions disallow deletion, it will not raise an error. Conversely, if the delete method does succeed, a call to FileExists directly afterward may return true because the system hasn't updated yet (or whatever actually goes on). Is there any way to accurately check the result of a deletion?
View Replies View Relatedwhy my results page is not coming back with anything?? I have set up a simple form in dreamweaver, it connects to a access database and IIS web server. When i test the recordset it works ok (returning the desired affect).
It uses a post method therefore the recordset uses form variable. But when i preview in browser(either IE or Firefox or Netscape) and enter text the browser comes back with something like the page does not exist or can't be found? It's not the recordset and result page so is there something else i'm missing?
i want to left join result sets together coming from two different databases based on a common field storenumber. They are separate databases as per management design.
Basically it should match rows based on the store number, those who don't have matches should display only the storenumber and no other info like: Code:
Store Q1 Q2 Q3 Q4
1 x x x x
2 x x x x
3 <--No data in 3, just display storenumber
4 x x x x
I have a search form that display result based on the user search criteria.
the result displayed through paging when the user select a specific product description to look at then go back
to the search result the user will lose it's place.
my question is:
How can I let the user search the database for all the products that I have then select a specific product to read the description of it
then be able to go back to the original search. I have the first part working fine but to be able to go back to the original search that I need your help. Code:
My web page is calling a result set that is displayed on the page. If I click refresh, it pops a warning saying, "The page cannot be refreshed without resending the information." I then have to click RETRY in order to refresh the page.
Is there anyway to automatically perform that action so that my users will not have to be prompted?
i am trying to make a search/result page(using asp, dreamweaver,iis,winnt,miscrosoft access database) wherein the results page brings up the most relevant words or phrases and not in alphabetical order.
View Replies View RelatedIn my search application, user can type a number to search. I use LIKE in my
query.
If a query result generates over 10,000 recordsets, it may several minutes
to run.
Is there a way to only query certain recordset at a time?
I found in SQL you can use "TOP". Like select TOP 100.... it will return
only top 100 records.
Is there a way to query may be from 101 to 200 then from 201 to 300...
My query is like: Select * from Product where PartNumber like '%" PartNumber
"%'
Any idea is welcome.
I'm working on a application where I've created a couple of Sub routines I call them from my ASP page.
But I would love to put the hole HTML including my "call showOffers" in my database and when I get the result set do I want to execute the "call showOffer". Is this possible?
I am struggling to come up with a way to save a forms' results, to a text file, but the name of the text file comes from the input of a user name on another forms...
ex. john doe enters pg1 & enters his name in a space on the page (form) . this links him to the next page, pge_form. I need the results of page_form to be named johndoe.txt
when creating a webpage that must display a large result set, the page load time is unbearable. Unfortunately, there are a lot of records and they all need to be displayed, at once, on this one page.
To reduce file size, I have minimized the amount of HTML tags used to dislay these records. My only other idea is to write javascript matrix to hold the data, and then to use dom to create the page on the client side. Are there any tried and true ways of speeding up page loads?
We have completed a clean install of Microsoft Server 2003
on our Web Server and are using frontpage 2002 for our web
site. On our asp page (www.dgf.k12.mn.us/contactus.asp) we
are getting the following error:
Database Results Error
Description: Syntax error in query. Incomplete query
clause.
Number: -2147217900 (0x80040E14)
Source: Microsoft JET Database Engine
www.dgf.k12.mn.us/contactus.asp
We cannot find any kind of documentation on this error.
Has anyone else seen this kind of error, and know how to
fix it?
This is my first post to this newsgroup, I have question regarding showing resultset to html. Let's say I have in resultset 200 rows, and I'd like to show on each page 10 of them, so it could look like for example google search results:
Results 1 - 10 of about 17,700 for "asp search engine" [results]
Result Page: [1] 2 3 4 5 6 7 8 9 10 Next
Is there some helpful script/guide?
I have a question about looping in a recordset. I'm actually showing some actualities in a page, based on a start and end date. All is working well. My problem is that I put a <hr> between each news, but I don't want a <hr> at the end of the last news. I would like to count how many results I have in my recordset so I would be able not to show the last <hr>.
View Replies View Related