thanks for replying.
I am using the sql server 2008 database for our access control system and depends on the card holder transaction for time attendance. I summarise the transactions (which minimum as the entry time and maximum as the exit time for that particular employee) grouped by date and i use the summaries as group footers and the datediff function to find the time he spends in the company.
the problem is with the night shift employees, where i need the datediff between groupfooter for today(as example) and group footer for yesterday.