public void endShift()
{
string sql = "INSERT INTO [FairyGodmotherTimestamp]([fairyGodmotherID], [timestamp], [status]) Select CONVERT(VARCHAR(50),FairyGodmotherTimestamp.fairyGodmotherID) , GetDate(), 'Pending' From FairyGodmotherTimestamp, (Select ID, lastname + ', ' + firstname AS Name FROM FairyGodmother) n, (Select fairyGodmotherID, max(timestamp) as TimeStamp FROM FairyGodmotherTimestamp Group BY fairyGodmotherID) a Where a.fairyGodmotherID= FairyGodmotherTimestamp.fairyGodmotherID and a.timestamp= FairyGodmotherTimestamp.timestamp and n.ID= fairyGodmotherTimestamp.fairyGodmotherID and FairyGodmotherTimestamp.status <> 'Pending' Order By transID";
database.ExecuteQuery(sql);
}