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"; Link to comment https://forums.phpfreaks.com/topic/225243-problem-using-as-when-there-is-a-function/ 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; Link to comment https://forums.phpfreaks.com/topic/225243-problem-using-as-when-there-is-a-function/#findComment-1163258 Share on other sites More sharing options...
will35010 Posted January 21, 2011 Author Share Posted January 21, 2011 Nevermind. I had a duh moment! Link to comment https://forums.phpfreaks.com/topic/225243-problem-using-as-when-there-is-a-function/#findComment-1163260 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.