select with DATE_FORMAT( )
am 11.11.2007 22:55:14 von docscsi
Dear all
I'm quite new to mysql. My aim is to select a date format field by
returning only the month and day number of it (e.g. date = 11 12). I
got this statement and I could not get out how to get rid of the
error:
SELECT `email`, `raum`, DATE_FORMAT('date',`%c %d`) as date FROM
`logger`;
#1054 - Unknown column '%c %d' in 'field list'
Is there a way to mascade `%c %d` so that mysql does not get it as a
field?
thanks in advance doc scsi
Re: select with DATE_FORMAT( )
am 11.11.2007 23:01:12 von zeldorblat
On Nov 11, 4:55 pm, docs...@googlemail.com wrote:
> Dear all
>
> I'm quite new to mysql. My aim is to select a date format field by
> returning only the month and day number of it (e.g. date = 11 12). I
> got this statement and I could not get out how to get rid of the
> error:
>
> SELECT `email`, `raum`, DATE_FORMAT('date',`%c %d`) as date FROM
> `logger`;
>
> #1054 - Unknown column '%c %d' in 'field list'
>
> Is there a way to mascade `%c %d` so that mysql does not get it as a
> field?
>
> thanks in advance doc scsi
Yeah -- don't enclose it in backticks. It's a string, not a column
name. Use single quotes instead.
Re: select with DATE_FORMAT( )
am 11.11.2007 23:50:04 von Jerry Stuckle
docscsi@googlemail.com wrote:
> Dear all
>
> I'm quite new to mysql. My aim is to select a date format field by
> returning only the month and day number of it (e.g. date = 11 12). I
> got this statement and I could not get out how to get rid of the
> error:
>
> SELECT `email`, `raum`, DATE_FORMAT('date',`%c %d`) as date FROM
> `logger`;
>
> #1054 - Unknown column '%c %d' in 'field list'
>
>
> Is there a way to mascade `%c %d` so that mysql does not get it as a
> field?
>
>
> thanks in advance doc scsi
>
>
For MySQL questions, ask in a MySQL newsgroup - such as
comp.databases.mysql.
This newsgroup is for PHP questions.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================