clarkson Posted July 15, 2013 Share Posted July 15, 2013 I have a table called employee in which there's a field called birth_date. Iwant to get the output in the format of Jan-01-2013.My sql is $sql="SELECT emp_name,emp_address,salary,DATE_FORMAT(birth_date,'%b,%d,%Y') AS birth_date FROM employee";$query=mysql_query($sql,$connect); But the query is not succesful. What have I done wrong?Any help to correct this please Link to comment Share on other sites More sharing options...
jaseervp@ymail.com Posted July 15, 2013 Share Posted July 15, 2013 select to_char(birth_date,'DD-Mon-YYYY') from employee; -- oracle syntax Link to comment Share on other sites More sharing options...
justsomeguy Posted July 15, 2013 Share Posted July 15, 2013 Check for errors with the query if it isn't returning any data. Is birth_date an actual date/time field, or something else like varchar? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now