Selecting from a datetime field in MySQL

[prev] [thread] [next] [Date index for 2005/01/25]

From: John Day
Subject: Selecting from a datetime field in MySQL
Date: 22:24 on 25 Jan 2005
Okay,

I have been bashing my head on this one for hours, maybe it is time for a 
new head.

Using Class::DBI and MySQL, I have a 'datetime' field in my record which 
stored the date and time to initiate an action. The MySQL is using the 
default datetime format ( 'YYYY-MM-DD hh:mm:ss' ).

How do I go about selecting based on the date, regardless of the time?

I need to find ALL RECORDS where the date part = todays date

AND

ALL RECORDS where the date part is BEFORE todays date.

(message missing)

one to one relationship revisited (has_own)
Peter Speltz 22:26 on 20 Jan 2005

Re: one to one relationship revisited (has_own)
Perrin Harkins 21:59 on 21 Jan 2005

Re: one to one relationship revisited (has_own)
Peter Speltz 05:11 on 22 Jan 2005

Re: one to one revisited (has_own)
Peter Speltz 18:16 on 22 Jan 2005

Re: one to one revisited (has_own)
William McKee 15:39 on 24 Jan 2005

Re: one to one revisited (has_own)
Peter Speltz 16:01 on 24 Jan 2005

Re: one to one revisited (has_own)
Andreas Fromm 08:19 on 25 Jan 2005

Re: one to one revisited (has_own)
Peter Speltz 19:34 on 25 Jan 2005

Selecting from a datetime field in MySQL
John Day 22:24 on 25 Jan 2005

Re: Selecting from a datetime field in MySQL
Perrin Harkins 22:29 on 25 Jan 2005

Re: one to one revisited (has_own)
Peter Speltz 23:24 on 26 Jan 2005

Re: one to one revisited (has_own)
Peter Speltz 17:40 on 01 Feb 2005

Re: one to one revisited (has_own)
Peter Speltz 08:23 on 25 Jan 2005

Generated at 12:39 on 05 Feb 2005 by mariachi v0.52