|
|
 |
Re: FN-FORUM: SQL Help (probably an easy one)
date posted 16th January 2007 10:06
[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.
>
> 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
>
> Thanks for your help!
>
>
>
What version of SQL are you using? As far as I'm aware, DATE_FORMAT()
and Month() are standard SQL commands and should work
Steve
|
 |
|