Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Code Support: ASP (Non-Forum Related)
 how to display a time greater than 24hour
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

s80ts0465
Junior Member

Italy
290 Posts

Posted - 29 January 2008 :  10:35:42  Show Profile  Send s80ts0465 an ICQ Message
I've within a mysql database some fields that come from a timediff so many times greater than 24hours.
If the value is less than 24 hour i can display with any problems, but at the same time the fileds become greater than 24hours i get an error.

to display the field i use:
strT = strT & "<TD bgColor=whitesmoke>" & hour(fldF.Value) &":"&minute(fldF.Value)&":"&second(fldF.Value)&" </TD>"


i know the the nolur() function return only value from 0 to 23, so how can i display time value greater than 24hours???

bye ste

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 29 January 2008 :  11:36:29  Show Profile  Visit HuwR's Homepage
you should use MOD and DIV to find out the number of days/hours in a value > 24

for example say you have 51hrs this would give you

days = 51 DIV 24 which is 2
hrs = 51 MOD 24 which is 3
Go to Top of Page

s80ts0465
Junior Member

Italy
290 Posts

Posted - 29 January 2008 :  15:07:08  Show Profile  Send s80ts0465 an ICQ Message
but how can i select the value of 51??
not hour() because it returnes value from 0 to 23, so how to select only the hour part??
Go to Top of Page

phy1729
Average Member

USA
589 Posts

Posted - 29 January 2008 :  16:50:37  Show Profile
help?
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 30 January 2008 :  01:55:56  Show Profile  Visit HuwR's Homepage
quote:
Originally posted by s80ts0465

but how can i select the value of 51??
not hour() because it returnes value from 0 to 23, so how to select only the hour part??



I'm afraid youv'e lost me
Go to Top of Page

s80ts0465
Junior Member

Italy
290 Posts

Posted - 30 January 2008 :  06:33:08  Show Profile  Send s80ts0465 an ICQ Message
i've not lost you. I understand your suggest and data manipulation, but in first i should save the value (in your example of 51hs) in a variable and than apply the manipulation.
The problem is how to save the value in a variable?in fact if i use the hour() function i get an error because greater than the allow range 0-23.

Moreover if i simply get the value from the field in mysql database (in tha database i've a time cell) when i display it on the asp webpage i get the correct time value stored in the mysql database, but also the date of the creation of the table!!!! This is the reason that have driven me to use the hour() function, to cancel the date from the web!!

any suggest???
Go to Top of Page

balexandre
Junior Member

Denmark
418 Posts

Posted - 30 January 2008 :  07:04:06  Show Profile  Visit balexandre's Homepage  Send balexandre an ICQ Message
quote:
Originally posted by s80ts0465

I've within a mysql database some fields that come from a timediff so many times greater than 24hours.


Isn't this value that we are all talk about? the timediff that your mySQL returns? so... in this example, that will be the 51!

Am I missing something?

Bruno Alexandre
(Strøby, DANMARK)

"a Portuguese in Danmark"


Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.37 seconds. Powered By: Snitz Forums 2000 Version 3.4.07