Connecting Tech Pros Worldwide Help | Site Map

select with DATE_FORMAT( )

docscsi@googlemail.com
Guest
 
Posts: n/a
#1: Nov 11 '07
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

ZeldorBlat
Guest
 
Posts: n/a
#2: Nov 11 '07

re: select with DATE_FORMAT( )


On Nov 11, 4:55 pm, docs...@googlemail.com wrote:
Quote:
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.

Jerry Stuckle
Guest
 
Posts: n/a
#3: Nov 11 '07

re: select with DATE_FORMAT( )


docscsi@googlemail.com wrote:
Quote:
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
==================

Closed Thread