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?
I am needing to response.write a variable within a snippet of Javascript. My Javascript code that I need to response.write with the variable is below:-Code:
response.write ("imageArray[ImageNum++] = new imageItem(image_dir + ""variable here"");")
I can response.write the static Javascript string fine. The problem arises when I try and state a variable into where it says, 'variable here' The variable I need to include is Code: rs.Fields("ImgURL") Would someone please be able to show me the correct formatting for this Javascript string which includes the variable.
My asp syntax is very lacking, it seems the double quotes that have been done by me are not what asp is looking for. Anyone that could correct my faulty thinking would be thanked.
how to display correct time according to user timezone i want to do an online meeting let say schedule meeting at 1:00pm server time, how do i display the correct time for users in their local time
I have a form where users can enter search criteria for various products. now, if this form has 2 fields, colour and size (it wil have more but I'm assuming the the principle for two fields will be the same for ten fields) what would be the correct syntax for performing a query where the user didn't enter a criteria for both fields? the search string would be
strSQL = "SELECT * FROM products where colour = " & "'" & request.form("searchstrcolour") & "'" & "AND size =" & "'" request.form("searchstrsize") & "'" & " ORDER by price"
so if the user selects blue and large, thats fine but what if the user only selected say blue and didn't bother with the size? is there a wild card that I could use?
can someone explain to me the diffrence between the 2 below and why one works and the other one doesnt.could you also explain what each part of the correct version is doing because i dont really no.
INCORRECT
sql = "SELECT * FROM userlogon WHERE (username)=' "& (username) & "' AND (password)=' " & (password) & " ' "
CORRECT
sql = "SELECT * FROM [userlogon] WHERE [username]=' "& username & "' AND [password]=' " & password & " ' "
i need to delete some values which have dates that are less than today's from a table. The date is in another table so i joined the two tables together and gave a clause
I did this:Code:
DELETE * FROM RMASerial, Sold WHERE RMASerial.SoldID=Sold.SoldID And Sold.Warranty_date<Date();
I have a few pages that require login to access. Assuming a user clicks a link containing a variable trying to access a password protected page. That user is redirected to the login page. After login, he's brought to a "logged in" page. How do I retain the original link he clicked and instead of redirecting to a logged in page, he's redirected to the page he originally requested?
Im trying to make a client area on my website and an not sure on how to go about editing clients details.When the client logs in they are brought to a menu where they can update there record. How can i get the appropriate record from the database so they can update there details?
I have a database which stores information,I have a page which has links to each of the rows in the database and to search by each row it has its own unique ID. The problem I am having is only one row keeps getting returned from the database.I have an access database and using ASP. I think the problem could be with the SQL statement.
SQL = "Select * FROM monitoring where monitoringID = & request('ID') &"
On asp.net, How can we programmatically verify whether the UserName and Password is Correct? and when i close the application directly and open again, is still in lon in status.?
i have this function in asp that should return false when a match is not found, but it keeps returning "exception occured". How do i go about getting this thing to work properly.Code:
public function isValidUserName(byVal user_name) dim sqlComm
sqlComm = "SELECT USERNAME FROM S_USER WHERE USERNAME = '" & user_name & "'"
set oRs = oConn.Execute(sqlComm)
' if a match is found then return true if oRs("username") = user_name then isValidUserName = true else isValidUserName = false end if
how to display correct time according to user timezone. i want to do an online meeting example: let say schedule meeting at 1:00pm server time, how do i display the correct time for users in their local time are there any tutorials to do this.
I have set with lcid value. but i am not able to overcome my nt server regional setting. Actually i want a date in mm/dd/yyyy. But i get date as mm/dd/yy. How to ensure that i shall always get correct format irrespective of os or regional setting.
I'm looking at another developers code and I'm now confused about the correct way to close a database connection and destroy the object. I would normally do it this way: Code:
I am having much difficulty having a form write to a DB... I am an ASP newbie and am noticing the errors are pointing to this script... currently this script is producing no error messages but when a user selects one of the chk options in the "Nominator code" section of my code, it won't write to tblNomCommVotes. Code:
I am trying to run one of my first ever asp scripts. It is a form I copied from the w3schools website along with its ASp script, demo_add.asp, both which i have modified very slightly(variable names for my own database etc).
However, "No update permissions" appears in my browser when i run the script - this means that there is an error. The problem is i dont what the error is!
The only thing I can think of at the moment is maybe my database location. I am using IIS are all my files are mapped to a virtual directory within IIS. Should the path in my HTML file below be to the harddrive location or its location within the virtual directory? Im assuming it is the hard drive location. Code:
There is a forecast table which needs to be filled in for each client as shown above, all the info is then saved in the DB and from this data I will need to generate a FORECAST REPORT (shown below). It forecasts the prospective amount of records we will receive for processing.
[IMG]forescast1.jpg[/IMG]
The columns are shown below… june, july, august, September, October, November are dynamically generated on form load, using the current month and working 6 months ahead. Thereafter represents any month after November (6 months from june).
I am having huge issues populating the correct columns shown below with the correct values from the db, so if the forecast for july is 1000, how will I display it in the 6th column in my report? Code:
I am doing ASP.Net and I really need the code for this...
somebody here could share the hard code if how can I check if the username and password are correct? just an example of piece of code or a hint only....
My Website is already in use and active . I have a problem with the date format . when I retrive a date from my database it is in the following format mm/dd/yyyy and I want it to be in this format: dd/mm/yyyy .
I asked for support from my hosting company . they said you can do that by manipulting through scripts . the date settings in my database is in the following format: dd/mm/yyyy .
I've just written a fairly complex stored procedure to update several databases at once and I need to run it in my asp code. It has two inputs, @userid and @partcode
previously I've ran stored procedures as follows: Code:
I`ve got a site that is built with this structure: www.theurl.com/Default.asp?page=archive&id=31
When I search Google for information that is in the article with id 31, Google shows the correct information but the link to it is wrong. It shows the link to the default.asp....
I'm trying to access an access database by including the DB's password within the connection string. I try to connect to the DB, but I get and "Incorrect Password" error. What am I doing wrong?
set conn=Server.CreateObject("ADODB.Connection") conn.Provider="Microsoft.Jet.OLEDB.4.0"; uid=admin; pwd="pass" conn.Open(Server.Mappath("maindb.mdb")) set rsUpdateEntry = Server.CreateObject("ADODB.recordset")
I am using the code below to add a date input into an access database.
Quote: rs.Addnew rs("Date")= Request.Form("Date")
Instead of inserting a date with the format dd/mm/yy, a date format of yy/mm/dd will be inserted into the database.
I entered the following code before the insertion Quote: response.write request.form("Date") and it displayed the correct date format as dd/mm/yy.
Pls how do I insert the date into the database for it to store the date as dd/mm/yy instead of as yy/mm/dd. The date format in the date field of the database is dd/mm/yy.