will35010 Posted January 21, 2011 Share Posted January 21, 2011 I'm having a problem with this query and using AS. I'm using this query to export to excel so I want to use AS on the FROM_UNIXTIME functions so the user doesn't see that. I tried enclosing the function into parenthesis, but that didn't work. How do I make it work? Thanks! $select = "SELECT (patients.lname) AS LastName, (patients.fname) AS FirstName, (patients.dob) AS DOB, (patients.sex) AS Sex, (visit_data.cc) AS ChiefComplaint, FROM_UNIXTIME(visit_data.reg_time), FROM_UNIXTIME(visit_data.discharged_time), (visit_data.disposition) AS Disposition, (visit_data.leftby) AS LeftBy FROM patients, visit_data WHERE discharge_date = '$date' AND patients.patientid = visit_data.patientid"; Quote Link to comment Share on other sites More sharing options...
will35010 Posted January 21, 2011 Author Share Posted January 21, 2011 In other words how do I make this work SELECT FROM_UNIXTIME(visit_data.reg_time) AS RegistrationTime FROM visit_data; I tried SELECT (FROM_UNIXTIME(visit_data.reg_time)) AS RegistrationTime FROM visit_data; Quote Link to comment Share on other sites More sharing options...
will35010 Posted January 21, 2011 Author Share Posted January 21, 2011 Nevermind. I had a duh moment! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.