Hello everyone: I am working on a time clock database.
I am trying to get only the records from TimeCardEntries where the dates fall between the current PAYPERIOD. The current payperiod is determined by Select TOP 1 From PayPeriods WHERE Status =0
Tables:
Table1 is PAYPERIODS
Table2 is TimeCardEntries
PAYPERIODS
ID,DateStart,DateEnd,Status
201701,2017-01-01,2017-01-13,1
201702,2017-01-14,2017-01-30,0
201703,2017-01-31,2017-02-14,0
201704,2017-02-15,2017-02-27,0
201705,2017-02-28,2017-03-14,0
TimeCardEntries
UserID,clockYear,WeekNo,hoursTotal,hoursREG,hoursOT
8,2017,3,0.3819,0.3819,NULL
8,2017,4,7.5511,7.5511,NULL
24,2017,4,-838.9997,-838.9997,NULL
1,2017,3,16.6459,16.6459,NULL
4,2017,3,-825.4902,-825.4902,NULL
4,2017,4,-838.9997,-838.9997,NULL
3,2017,3,29.6834,29.6834,NULL
3,2017,4,-838.9997,-838.9997,NULL
9,2017,3,17.1631,17.1631,NULL
5,2017,3,42.4722,40,2.4722
5,2017,4,7.4892,7.4892,NULL
11,2017,5,16,16,NULL
Thank you you for you help!