|
-
Mar 9th, 2010, 12:50 AM
#1
Thread Starter
Junior Member
i need help on datediff function
hi guys. is it ok if i ask questions here pertaining to my project? i was told to do a program in VB about internet cafe billing program. its like, i have a server in my cafe and a customer wants to log in. so i enter PC #1 and the timer starts. after several minutes he decided to stop so i search for PC #1 and the number of hours and rate will be automatically show.
any help pls? my prof at school haven't teach use that topic yet
any links, codes, or explanation will be very well appreciated. thanks!
-
Mar 9th, 2010, 02:35 AM
#2
Re: i need help on datediff function
So your problem is the DateDiff-part.
Store the time when a user logs in and when he logs out, both as Date.
Code:
HouresUsed= DateDiff("h",LogInTime,LogOutTime)
I hope your Prof did teach the rest ;-)
You're welcome to rate this post!
If your problem is solved, please use the Mark thread as resolved button
Wait, I'm too old to hurry!
-
Mar 10th, 2010, 02:31 AM
#3
Thread Starter
Junior Member
Re: i need help on datediff function
so hoursused is lblhoursused.caption? so if i assign log in = now, will that time freeze or will it keep moving? damn im too newbie
-
Mar 10th, 2010, 07:48 AM
#4
Re: i need help on datediff function
 Originally Posted by cherrydee
so hoursused is lblhoursused.caption? so if i assign log in = now, will that time freeze or will it keep moving? damn im too newbie
Based on opus's code:
LogInTime and LogOutTime are two variables that store the time of logging in and logging out respectively.
You have to store the time of both operations. Then only you will be able to use that line of code.... 
When you store a value to a variable, that value will be available until it is cleared from the memory. (Tutorial: http://www.vbforums.com/showthread.php?t=468662)
Check this FAQ section to know more: http://www.vbforums.com/showthread.php?t=348141
If my post was helpful to you, then express your gratitude using Rate this Post. 
And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet
Social Group: VBForums - Developers from India
Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|