Garayed.com  

Go Back   Garayed.com > mySQL
FAQ Members List Calendar Search Today's Posts Mark Forums Read


Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-14-2008, 02:49 PM
CH
 
Posts: n/a
Default date_format

I have just tried to use the date_format in my query and it doesn't
return anything?
Please can anyone see any obvious errors?

$sql="SELECT DATE_FORMAT(post_date,'%W %b %Y'),post_title FROM mytable
WHERE MONTH(post_date) = 7 ORDER BY event_start";

post_date and post_tile are fields in the db.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 06-14-2008, 03:08 PM
CH
 
Posts: n/a
Default Re: date_format

I think I have found an answer to this!

I have added the "as col3" bit in here. This works now.

SELECT col1,col2,DATE_FORMAT(col3,'%a %d %M %Y') as col3 FROM mytable
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 02:14 AM.




LinkBacks Enabled by vBSEO 3.0.0 © 2007, Crawlability, Inc.