473,396 Members | 2,033 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

[ASP] Time and minutes

263 100+
Hi there.

I have this code ASP from to calculate time and minutes:

Expand|Select|Wrap|Line Numbers
  1.  
  2. '**********************************
  3. 'ORE STRAORDINARIO
  4. strORESTRAORDINARIO = formatnumber(Rs("strORESTRAORDINARIO"),2)
  5.  
  6. lngStartPos = 1
  7. strSearchFor = "," 
  8.  
  9. lngFoundPos = InStr(lngStartPos,strORESTRAORDINARIO,strSearchFor)
  10.  
  11. Do While lngFoundPos > 0 
  12.  
  13.     lngStartPos = lngFoundPos + 1 
  14.     lngFoundPos = InStr(lngStartPos,strORESTRAORDINARIO,strSearchFor) 
  15.  
  16.     strORESTRAORDINARIO_Min1 = replace(strORESTRAORDINARIO, ",", "")       
  17.  
  18.     ore = strORESTRAORDINARIO_Min1 \ 60
  19.     min = strORESTRAORDINARIO_Min1 mod 60
  20.  
  21.     strORESTRAORDINARIO_2 = ore &","& min   
  22.  
  23.     response.write strORESTRAORDINARIO_2
  24.  
  25.  
  26. Loop 
  27.  
  28. '**********************************
  29.  
But value returned is 7,00 in strORESTRAORDINARIO_2, while in the tbl of database the values are:

1,45 + 1,45 + 1,30 = 4,20 ===> time:5, minutes:00

Can anyone help?

Thanks, regards
Viki
Nov 26 '07 #1
1 1158
viki1967
263 100+
Expand|Select|Wrap|Line Numbers
  1.  
  2.    strSQL = " SELECT *, "
  3.    strSQL = strSQL & " SUM(ORE_STRAORDINARIO) AS strORESTRAORDINARIO "
  4.    strSQL = strSQL & " FROM PRESENZE_PERSONALE "
  5.    strSQL = strSQL & " WHERE "
  6.    strSQL = strSQL & " ID_GEST = " & ID_GEST & " "
  7.    strSQL = strSQL & " AND ID_COD = " & ID_COD & " "
  8.  
  9.  
  10. Set Rs = Server.CreateObject("ADODB.Recordset")
  11. Rs.Open strSql, objconn
  12.  
  13. If Not Rs.EOF Then
  14. Do while NOT Rs.EOF
  15.  
  16. '**********************************
  17. 'ORE STRAORDINARIO
  18. strORESTRAORDINARIO = formatnumber(Rs("strORESTRAORDINARIO"),2)
  19.  
  20. lngStartPos = 1
  21. strSearchFor = "," 
  22.  
  23. lngFoundPos = InStr(lngStartPos,strORESTRAORDINARIO,strSearchFor)
  24.  
  25. Do While lngFoundPos > 0 
  26.  
  27.     lngStartPos = lngFoundPos + 1 
  28.     lngFoundPos = InStr(lngStartPos,strORESTRAORDINARIO,strSearchFor) 
  29.  
  30.     strORESTRAORDINARIO_Min1 = replace(strORESTRAORDINARIO, ",", "")       
  31.  
  32.     ore = strORESTRAORDINARIO_Min1 \ 60
  33.     min = strORESTRAORDINARIO_Min1 mod 60
  34.  
  35.     strORESTRAORDINARIO_2 = ore &","& min   
  36.  
  37.     response.write strORESTRAORDINARIO_2
  38.  
  39.  
  40. Loop 
  41.  
  42. '**********************************
  43.  
  44. Rs.MoveNext
  45. Loop
  46. End if
  47.  
  48. Rs.Close
  49. set Rs = nothing
  50.  
  51. objconn.Close
  52. set objconn = nothing
  53.  
  54.  
Nov 26 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: No Spam Please | last post by:
I have a script. Its a login form that has the user enter their First Name, Last Name and ID #. That data along with the currdate and currtime is placed in an access database and the framed page...
9
by: E Sullivan | last post by:
I am having a time out issue when multiple users are accessing the server. This time out does not happen all of the time. My understanding is that the time out value is actually set in two places....
9
by: Vito DeCarlo | last post by:
I've been having this problem for a few weeks. PLEASE read this post before responding with some simple reason that has nothing to do with my problem. If you need more information, please request...
6
by: Chase | last post by:
I'm pretty new to asp.net and am having problems with my application timing out. I've written an application that loops through all of the information on an excel spreadsheet and does certain...
10
by: Amelyan | last post by:
It takes VS 2005 1, 2, and somtimes 3 MINUTES to compile ASP.NET 2.0 website when external DLL is modified. As a matter of fact, when I click 'Build', it looks like VS 2005 hangs for most of that...
6
by: Mad Scientist Jr | last post by:
My asp.net pages sessions are timing out after 20 minutes, and when I asked my Web host about it they said due to the nature of a shared hosting environment they cannot allow for sessions to keep...
0
by: shamirza | last post by:
· What is view state and use of it? The current property settings of an ASP.NET page and those of any ASP.NET server controls contained within the page. ASP.NET can detect when a form is requested...
5
by: Masso | last post by:
Hallo to the group, my question is this: where i have to set timeout in a web application? If i set into sessionState with property Timeout="60", after 20 minutes the session is over. Always...
6
by: Allan Ebdrup | last post by:
I have a webservice written in dotNet1.1 that does some stuff and calls a webservice written in dotNet 2.0. I'm using a Visual Studio 2005 webtest and loadtest to test webservice. When I load...
10
by: mukeshrasm | last post by:
Hi the code written below is for calculating the number of days remain for a particular event based on the specific local time i.e. time in new york or time in london. <style style="text/css">...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.