public DataSet getCinderellaStatus(string statustocheck, string orderby)
{
string time = DateTime.Now.ToShortDateString();
string query = "SELECT transID, CinderellaTimestamp.cinderellaID, n.Name, CinderellaTimestamp.timestamp, CinderellaTimestamp.status, n.apptDate, n.apptTime FROM CinderellaTimestamp, (SELECT ID, lastname + ', ' + firstname AS NAME, apptDate, apptTime FROM Cinderella) n, (SELECT cinderellaID, MAX(TIMESTAMP) AS TIMESTAMP FROM CinderellaTimestamp GROUP BY cinderellaID) a WHERE a.cinderellaID= cinderellaTimestamp.cinderellaID AND a.timestamp= cinderellaTimestamp.timestamp AND n.ID= cinderellaTimestamp.cinderellaID AND cinderellaTimestamp.status='";
query += statustocheck + "' Order By " + orderby;
return database.getDataSet(query, "tableName");
}