Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Selecting with DATE_FORMAT

Status
Not open for further replies.

lhg1

IS-IT--Management
Mar 29, 2005
134
DK
Hi

I want to select everythin from a specifik day. from a datetime field.

Code:
SELECT * FROM `prodlog` 
WHERE DATE_FORMAT(`starttid`, '$Y-$m-$d') = '2007-04-10'

It just does not give me the enteryes in the datebase with this date.

/lhg
 
I think it would be simpler for you to use date() instead of date_format(). Date() extracts the date part of a datetime field, and supplies that date in the standard MySQL format, YYYY-MM-DD.

Anyway, read the MySQL online manual entry for date_format() (link). You'll find that your dollar-signs are not the right symbol to use.



Want the best answers? Ask the best questions! TANSTAAFL!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top