Digits Calculating
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 Replieswhen 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 RepliesHow can I create a loop that goes from 01 to 12, to show months of the year as two digits, or how do I change "1" to "01"
View Replies View RelatedThis is probably an easy answer, however my mind seems to have gone blank about scanning a barcode in, and taking the 1st 4 digits of the number and storing it into a session variable to be referenced later in this application.
This session variable will then be checked against an ACCESS database to see if the product exists. I assume I use the LEN function? LEN(VariableName, 4)?
How do you change the DateDiff function to give only 2 digits?
[CODE]
ltOffHours = Abs(DateDiff("h", CDate(rsRecs("EndTime")), CDate(rsRecs("StartTime"))))
ltOffMinutes = Abs(DateDiff("n", CDate(rsRecs("EndTime")), CDate(rsRecs("StartTime"))))
ltOffTime = ltOffHours & ":" & ltOffMinutes
It gives me I.E. 4:345, I need have it read only 4:34 minutes. anyone know how to do this?
I saw in SPF an ASP code that was usable to hide the first digits of a credit card number and replace them by a "*". I'm really sorry to post such a thread, but I can't find it back. Does anyone have the link? I've tried to check it in the funky functions and sections like that. Maybe just missed it but well. tried to see many times.
View Replies View RelatedI have an access database with a table called jobs with a field called 'jobnumber'. I have this set up with a format mask of "0000" so that "1" becomes "0001" etc.
However when pulling this data out in Dreamweaver the formatting is lost.
Does anyone know how I can set this in Dreamweaver?
converting a single
digit (ie: 1, 2, 3, etc) to double digits (ie: 01, 02, 03, etc).
I am trying to convert the date in DD/MM/YYYY format so it is always displayed as 01/01/2004 instead of 1/1/2004.The script I am trying to embed this into has similar attributes to the Calendar on this site located at http://www.asp101.com/samples/calendar.asp.and the objects that require to be double digits are iCurrent and Month(dDate).
I am using Ms Access database and I have set 3 digits (e.g. 000) for an autonumber field of my table.Its working fine in Access and incrementing automatically like this (001, 002, 003 ...), but when I call the data on a web page using ASP its displaying these numbers like this (1, 2, 3, 4 ...) I dont understand why is it not displaying the numbers as it is in the table.
View Replies View RelatedI am storing a datetime into SQL Server 2000 field in datetime format. For single-digit months and dates, it is leaving the 0 off, like this:
11/6/2003
1/5/2003
For reasons having to do with technical requirements, I need to have it put the 0 in when needed, and not do it when it already has 2 digits:
11/06/2003
01/05/2003
How can this be done? When I get the value of the date in the first place, it is using the Now() function. For some fields, I only need the date, not time, so I do a DateValue around the result of the Now. Is this solved with ASP? Or do I need to do something in SQL Server?
in my asp form i would like to have a field which can ONLY accept
digits BUT can accept special characters as well such as: &,$$,##.
i.e: if the user enters :
147hhh, or P44556HH or QSSPE$% ---> this will be invalid
##123,45SS---> this is invalid
125&125#10$---> this is valid
12456--> this is valid too
is there any way to do this????
I have variable, say "total". It can be an integer or floating number.
No matter what value it stores (5 or 5.1 or 5.24), when I display it, is
there a way I can make it display it with fixed 2 decimal digits, like 5.00?
I currently am using a script which submits full state names to a payment processor. However, the payment processor only accepts 2 digit state names. Does anyone have a premade code for asp that converts state names into 2 digit ones.
example:
If statename = "New York" Then
statename = "NY"
End If
for each state.
I have a 5 digit account number, but I need only the first 2 digits of the number.
This shows the account number <%=rsSelSpecials("olaid")%>.
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 RelatedI'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?
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
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 RelatedI 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 RelatedLet'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 RelatedI 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:
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?
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.
i have a form for users to enter their name password and e-mail,i am currently using javascript to check that all details have been filled,
if(myForm.fname.value=='')
{
alert("Plz enter a first name")
return false
}
This works if the field is left blank however if the user enters numbers(1,2) or spaces i.e.(" ") how do i deal with these,i also need to check that the e-mail contains "@" and "."
I need a function for blocking or converting letters inserted into a Form to digits, since the Data will be used in mathematical functions.
Is there a specific seach-function for letters, or:
If Input1(not a digit) then...
Else... Input1 * 5...
?
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.
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?
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.
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.
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?
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 RelatedI 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, .
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:
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: