473,748 Members | 10,649 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

select with DATE_FORMAT( )

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('da te',`%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

Nov 11 '07 #1
2 3008
On Nov 11, 4:55 pm, docs...@googlem ail.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('da te',`%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.

Nov 11 '07 #2
do*****@googlem ail.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('da te',`%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.
js*******@attgl obal.net
=============== ===

Nov 11 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
15020
by: Jim Min | last post by:
Anyone can explain the following? Table definition: CREATE TABLE testdate ( SalesDate DATETIME, SalesTotal DOUBLE, PRIMARY KEY (SalesDate) )
2
6778
by: vncntj | last post by:
I'm trying to get the venue in the 'List' column when in contains a value. But if the venue Is Null then place the event in the 'List' SELECT CASE WHEN event Is Null THEN venue Else event End as 'List' ,DATE_FORMAT(fld_date, '%M') as Monthly
3
7388
by: sang | last post by:
Hai I want to change the date format at the time of inserting the record. i done it but one error in the insertion. The query is insert into mytable(update) values(date_format( '2006-10-09','%d%m%y'); Query OK but in the out put it will be in the form of '2009-10-06' ie in the date field 20 is added
6
2043
by: alex.kemsley | last post by:
Hi guys, I have the following sql statemant to search a mysql database that gets if values from a form with combo box's in. SELECT * FROM hottubs, manufacturers WHERE manufacturers.manid = hottubs.manid AND hottubs.type = '%s' AND hottubs.dimlength <= '%s' AND hottubs.dimwidth <= '%s' AND hottubs.dimhight <= '%s' AND hottubs.seatsto <= '%s' AND hottubs.shape = '%s' ORDER BY $thesearchtype_search.
2
13555
by: chrisale | last post by:
Hi All, I've been racking my brain trying to figure out some sort of Sub-Select mySQL statement that will create a result with multiple rows of averaged values over a years time. What I have is weather data. There is a new record every 5 minutes, every day. So. What I want to do with one SQL statement is figure out the Average of those 5 minute records over each day, for every day of the year.
3
2527
by: adamalton | last post by:
I am trying to take a date in the format "YYYY-MM-DD" and get from it the month as a word (e.g. July) and the day as a 2 digit number (e.g. 24). I am trying to use the date_format function, (new as of php 5.2) but I can't get it to work... $date = "2007-06-22 00:00:00"; //I also tried $date = "2007-06-22"; but that didn't work either //I also tried adding strtotime($date); but that didn't help! $month = date_format($date , 'F');
16
2408
by: laverdir | last post by:
<? $query = "SELECT " . $this->tabela3 . ".id, " . $this->tabela3 . ".naziv, " . $this->tabela3 . ".spisatelj, " . $this->tabela3 . ".najava, " . " DATE_FORMAT(" . $this->tabela3 . ".vrijeme_stavljanja, '%e. %c. %Y. %k:%i') FROM " . $this->tabela3 . ", " . $this->tabela2 . " AS xref WHERE " . $this->tabela3 . ".id=xref.spis_id AND xref.vrsta_id=" . $this->DB->quote($vrsta) . " ORDER BY " . $this->tabela3 . ".vrijeme_stavljanja DESC"; ?>
2
1126
by: runway27 | last post by:
hi i have an enquiry table which collects information about users making an online travel enquiry the fields in the table are = StoryTitle, EndCity, mode, PricedFrom, numAdults, numChildren, numInfants presently the select query is
2
1816
by: ann86 | last post by:
Hello, I am a newbie to PHP and I am working on a site that was created by someone else. The server was updated yesterday so now I am getting the error Fatal error: Cannot redeclare date_format(). I know that this is built in with PHP 5 but I need to know how to fix it without getting another error message saying that my cookies are disabled. Can anyone please help me?
0
8830
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9541
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9370
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9321
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6796
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4602
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3312
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2782
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2215
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.