MySQL Lists are EOL. Please join:

List:General Discussion« Previous MessageNext Message »
From:Jim Lyons Date:February 1 2010 2:32pm
Subject:Re: Selecting Dates
View as plain text  
Shouldn't it be:
SELECT * FROM orders WHERE order_date >= '2010-01-01' AND order_date <=
'2010-01-30' ORDER BY order_date;

?

change the "=>" and repeat the column_name.  Datetime should be datetime or
timestamp;

On Mon, Feb 1, 2010 at 8:25 AM, <sureshkumarilu@stripped> wrote:

> Hi
> What is the datatype of the column order_date. Give the full form of the
> date for the between condition.
>
> Thanks
> Suresh Kuna
> MySQL DBA
> ------Original Message------
> From: ML
> To: mysql@stripped
> Subject: Selecting Dates
> Sent: Feb 1, 2010 7:05 AM
>
> Hi All,
>
> Switching from Oracle to MySQL, I seem to be having some difficulty
> selecting dates using between or even where >= and <= like:
>
> SELECT * FROM orders WHERE order_date BETWEEN='2010-01-01' AND '2010-01-30'
> ORDER BY order_date;
>
> or
>
> SELECT * FROM orders WHERE order_date =>'2010-01-01' AND <= '2010-01-30'
> ORDER BY order_date;
>
> Neither of these work.
>
> What am I missing?
>
> -ML
>
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:
> http://lists.mysql.com/mysql?unsub=1
>
>
>
> Sent from BlackBerry® on Airtel




-- 
Jim Lyons
Web developer / Database administrator
http://www.weblyons.com

Thread
Selecting DatesML1 Feb
  • Re: Selecting DatesLucky Wijaya1 Feb
  • Re: Selecting DatesPaul DuBois4 Feb
Re: Selecting Datessureshkumarilu1 Feb
Re: Selecting DatesJim Lyons1 Feb
  • Re: Selecting DatesML1 Feb