vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| We have a transaction record that, for the sake of brevity, I will us a simple paradigm to convey my need: A sales clerk sells several pairs of shoes over the period of a day each & every day the clerk works. Each transaction is recorded i a database. All clerks use a single physical register but login t capture unique ID. As each clerk logs in, it automatically logs ou the prior user and writes a zero-dollar record Each record logs the RcdNbr, clerk's ID, date-timestamp and sale amount. (Other fields not pertinent to this discussion) Example: Rcd...CID...yyyy-mmdd.hhmm...Sal 001...ABC...2005-0101.0850...10.00 002...ABC...2005-0101.0930...00.00 003...DEF...2005-0101.1000...15.5 004...DEF...2005-0101.1200...00.0 005...ABC...2005-0101.1300...12.83 006...ABC...2005-0101.1530...00.0 The above is unsorted. I would first sort by CID (ClerkID) to get: Rcd...CID...yyyy-mmdd.hhmm...Sal 001...ABC...2005-0101.0850...10.00 002...ABC...2005-0101.0930...00.00 005...ABC...2005-0101.1300...12.83 006...ABC...2005-0101.1530...00.0 003...DEF...2005-0101.1000...15.5 004...DEF...2005-0101.1200...00.0 As a double-check of a clerk's actual worked hours we want to extrac the last record for each clerk for each day. In the above sample, I' need records 004 & 006 The transaction file covers 6 months worth of data. Is there a statement that I can construct that would extract the las (greatest?) time for each clerk for each day |