I do support for a POS system and the users have found some way to screw things up.
I have two table that are giving me issues
1. Shifts - with columns SfActionDate, SfTillClose, Sfcode
2. Receiptbase - with columns rcbShiftDate, rcbActionDate, rcbShiftnum
When someone logs in for the day, it puts a 0 in the SftillClose, when they logout for the day it puts a 1.
Somehow the users have been able to have the 0 on one date and the closing on another. If this happens the program will not allow them to "close the drawer" for the day.
I had been identifying which Sfcode has the issue by doing the following:
Select * from shifts where sftillclose=0 and sfactiondate= '2007-??-??'
-ed where the ?? equals the date I can not close the drawer on
I then find the offending SFcode which joins Receiptbase on rcbShiftnum
select * from receiptbase where rcbshiftnum=???
I had manually been fixing these everyday it happened using the following script updated with that date and the offending shiftnum(s)
update shifts set sfactiondate= '2007-03-26' where sfcode in (7172,7241)
update recieptbase set rcbshiftdate = '2007-3-26' where rcbshiftnum in
(7172,7241)
when the update is ran, all the closing and opening happen on the same date and all the sales have the same date. I can then finally close the drawer.
But I have been doing this for 2 months while waiting on the devs to fix it. And it's mind numbing,
What I need is a update statement that will automate the process without having to give it dates or shift numbers.
I have two table that are giving me issues
1. Shifts - with columns SfActionDate, SfTillClose, Sfcode
2. Receiptbase - with columns rcbShiftDate, rcbActionDate, rcbShiftnum
When someone logs in for the day, it puts a 0 in the SftillClose, when they logout for the day it puts a 1.
Somehow the users have been able to have the 0 on one date and the closing on another. If this happens the program will not allow them to "close the drawer" for the day.
I had been identifying which Sfcode has the issue by doing the following:
Select * from shifts where sftillclose=0 and sfactiondate= '2007-??-??'
-ed where the ?? equals the date I can not close the drawer on
I then find the offending SFcode which joins Receiptbase on rcbShiftnum
select * from receiptbase where rcbshiftnum=???
I had manually been fixing these everyday it happened using the following script updated with that date and the offending shiftnum(s)
update shifts set sfactiondate= '2007-03-26' where sfcode in (7172,7241)
update recieptbase set rcbshiftdate = '2007-3-26' where rcbshiftnum in
(7172,7241)
when the update is ran, all the closing and opening happen on the same date and all the sales have the same date. I can then finally close the drawer.
But I have been doing this for 2 months while waiting on the devs to fix it. And it's mind numbing,
What I need is a update statement that will automate the process without having to give it dates or shift numbers.