|
|
 |
Re: FN-FORUM: SQL Help (probably an easy one)
date posted 16th January 2007 14:31
On 16 Jan 2007 10:43:16 -0000, [EMAIL REMOVED] [EMAIL REMOVED] wrote:
>
> Hello
>
> I tried this
>
> SELECT *
> FROM newmenudata
> WHERE DATE_FORMAT(timeadded, '%b') = 'Jan'
>
> Or something very similar.
>
> http://dev.mysql.com/doc/refman/4.1/en/date-and-time-functions.html
>
> Dave...
>
> AND
>
> WHERE Month(timeadded) = 1
>
> With NO LUCK!
>
> It says DATE_FORMAT and Month is not compatible.
What *exactly* does it say? What type is your timeadded column? It's
not just an INT with a unix timestamp stored in it is it?
> I am so confused...
>
> Anyway if anyone can tell me how I can query the first 3 letters of a column for
> Example I want to get the first 3 letters of January to get Jan
Don't do that. The names of months vary depending on what locale MySQL
is configured with. Compare month numbers instead.
-robin
|
 |
|