Shoutbox

VB Help (DateDiff) - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Skype & Technology (/forumdisplay.php?fid=9)
+---- Forum: Tech Talk (/forumdisplay.php?fid=17)
+----- Thread: VB Help (DateDiff) (/showthread.php?tid=46240)

VB Help (DateDiff) by spokes on 06-13-2005 at 04:54 PM

ok, im making a program, and its going to count how many minutes are between 2 times, the times are from the same day btw, and i don't know how to do it.

i know i need to use datediff



[do not need to read to answer question]
Anyway, this program i'm making is for my coursework for ict, i have to choose a company and show ways they can improve by using computers.
so i've picked my local skatepark, who, when you enter it write your name down on paper, and put it in a shelf/box with a time on the front (I.E i got there at 4PM and ask for 2 hours, so they put my name in the 6PM box, and then at 6PM they call my name out)
well, i'm making a program that does it all on a pc, and gives notification when it's time for them to leave.
i'm trying to add a feature so they can see how many Hours and minutes they have left, but i can't figure it out
[/do not need to read to answer question]

Anybody?

Edit : I have

code:
Label2(3) = DateDiff("h", Time, strLeave)

but it's returning 1 hour even though it should be 1 hour 30 mins
RE: VB Help (DateDiff) by Dempsey on 06-13-2005 at 05:00 PM

you should be able to do

code:
label2(3) = datediff("h",time,strleave) & " hours " & datediff("m",time,strleave) & " minutes"

Something like that
RE: VB Help (DateDiff) by spokes on 06-13-2005 at 05:04 PM

Doesn't work, if they got 59 mins left it still says 1 hour 0 mins


RE: VB Help (DateDiff) by Dempsey on 06-13-2005 at 05:08 PM

weird worked when i just tried it, are you sure you got the two times correct?


RE: VB Help (DateDiff) by spokes on 06-13-2005 at 05:10 PM

might it be because time is (xx:xx:xx) and strLeave is only (xx:xx)  ??

edit : no one has replied in 3 hours :|