Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > Beginning VB 6
|
Beginning VB 6 For coders who are new to Visual Basic, working in VB version 6 (not .NET).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning VB 6 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 14th, 2007, 11:27 PM
Authorized User
 
Join Date: Aug 2007
Posts: 35
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to zrtv
Default Time shift logic ADVANCED-plz help

Hi All,
I am working in an attendance software,I am stuck in the following,

before pointing to the real problem i will tell you some features.
    1) There is no shift timing employee can swap
    the card any time and no restriction in number of swap.
    2) The timing can be night shift also.

My real problem is the second point, I thought that i can count the swap entry
for eg: in particular date first entry can be treated as "IN" second entry treated as "OUT" and goes on...,It was working fine if the time not going after "24:00" if it crosses then the
entry is considering again as "IN" because its a new day,

Can anybody have the logic for this????

 
Old September 15th, 2007, 08:11 PM
Friend of Wrox
 
Join Date: Sep 2005
Posts: 812
Thanks: 1
Thanked 53 Times in 49 Posts
Default

One method would be to check the previous swipe.. If it is IN, then even if it crossed 24:00 it should be made as OUT

Another solution I can think of is to check the difference in hours. Assuming there are no continuous shifts, an IN can be re-registered only if there is a time difference of say 10-16 hrs. You can use datediff function for that (http://vbadud.blogspot.com/search/label/VBA%20DateDiff)

Cheers
Shasur

http://www.dotnetdud.blogspot.com

VBA Tips & Tricks (http://www.vbadud.blogspot.com)
 
Old September 16th, 2007, 12:04 AM
Authorized User
 
Join Date: Aug 2007
Posts: 35
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to zrtv
Default

Hi Shashur,
Thanx for your reply, First point you said will be valid only if "IN" done before 24.00, what if the last Swipe is for "OUT" before 24.00 hrs. then it will be considered as New day instead of OT hours.

and the next point i cant understand completely.



 
Old September 16th, 2007, 11:22 PM
Friend of Wrox
 
Join Date: Sep 2005
Posts: 812
Thanks: 1
Thanked 53 Times in 49 Posts
Default

Hi

The second method has to do with the time difference between the In and OUT

If there is a time difference between the lastswipe and the currentr swipe is more than say 10 hrs.. then the current swipe should be obivously IN right!

Regards
Shasur

http://www.dotnetdud.blogspot.com

VBA Tips & Tricks (http://www.vbadud.blogspot.com)
 
Old September 17th, 2007, 12:13 AM
Authorized User
 
Join Date: Aug 2007
Posts: 35
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to zrtv
Default

Hi Shasur,
Thanx for your time and reply,
The second point u told is very useful one, but the problem is
my client don't want to fix the shift schedule, they need less manual interaction with the software.

I have an idea, Can you provide your valuable suggestion for the following?
 My idea is fix one button in the reader for overnight punching
for eg: thos who working after 24.00 hrs will press key no: "1" and swipe, Then the particular punching will be considered as overnight punching and it will be calculated with the previous day.


 
Old September 17th, 2007, 02:08 AM
Friend of Wrox
 
Join Date: Jan 2006
Posts: 180
Thanks: 1
Thanked 1 Time in 1 Post
Send a message via ICQ to dpkbahuguna Send a message via MSN to dpkbahuguna Send a message via Yahoo to dpkbahuguna
Default

I have already face this problem couple of days before...
you dont have any other option except compare the times with the shift timings it is the collection of condition nothing more...
check all the conditions....
:)
best of luck!!!!

DPK..





Similar Threads
Thread Thread Starter Forum Replies Last Post
Time Shift time in minus time out lechalas Beginning VB 6 1 August 11th, 2008 01:56 PM
Time Shift Logic !!! dpkbahuguna Beginning VB 6 3 August 31st, 2007 11:56 AM
Shift + Enter OR Shift+Double-Click phungleon Access 2 May 20th, 2004 10:14 AM
How to Change value in Date Time Picker, Help PLZ shopgirl Classic ASP Professional 2 April 29th, 2004 08:34 PM
Mixing Data access logic and business logic polrtex BOOK: Professional Jakarta Struts 0 December 15th, 2003 07:19 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.