From DATE_FORMAT and back to origin date in mysql date column

2013-07-24 Thread Karl-Arne Gjersøyen
SELECT DATE_FORMAT(dato, '%e/%c/%Y') AS dato FROM transportdokument WHERE dato = '2013-07-20' AND dato = '2013-07-24' GROUP BY dato DESC is working perfect in my PHP file. But I need to transfer the date back from my norwegian formatted date to the origin date format in WHERE dato

RE: From DATE_FORMAT and back to origin date in mysql date column

2013-07-24 Thread Rick James
...@gmail.com] Sent: Wednesday, July 24, 2013 7:02 AM To: MySQL Mailinglist Subject: From DATE_FORMAT and back to origin date in mysql date column SELECT DATE_FORMAT(dato, '%e/%c/%Y') AS dato FROM transportdokument WHERE dato = '2013-07-20' AND dato = '2013-07-24' GROUP BY dato DESC is working perfect

DATE_FORMAT parameter question

2010-04-09 Thread Martin Gainty
Good Afternoon All following the documentation available at http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html i wish to select a date using DD-MON-YY format but my format of '%y-%b-%d' appears to be incorrect mysql select DATE_FORMAT('11-10-09','%y-%b-%d') from DUAL

Re: DATE_FORMAT parameter question

2010-04-09 Thread Jo�o C�ndido de Souza Neto
Basicay, your date_format works like: select DATE_FORMAT('YY-MM-DD','%y-%b-%d') from DUAL; Martin Gainty mgai...@hotmail.com escreveu na mensagem news:blu142-w2137936b18ae273dbd6cb1ae...@phx.gbl... Good Afternoon All following the documentation available at http://dev.mysql.com/doc/refman

RE: DATE_FORMAT parameter question

2010-04-09 Thread Martin Gainty
To: mysql@lists.mysql.com From: j...@consultorweb.cnt.br Subject: Re: DATE_FORMAT parameter question Date: Fri, 9 Apr 2010 12:56:46 -0300 Basicay, your date_format works like: select DATE_FORMAT('YY-MM-DD','%y-%b-%d') from DUAL; Martin Gainty mgai...@hotmail.com escreveu na mensagem

Re: DATE_FORMAT parameter question

2010-04-09 Thread Carsten Pedersen
If you'll excuse the shameless plug: I once created a tool to help find the exact parameters to use for PHPs date() and MySQLs DATE_FORMAT(). Please see http://bitbybit.dk/php/date_format/ (Yes, it looks horrible. But it works) / Carsten Martin Gainty skrev: Good Afternoon All following

RE: DATE_FORMAT parameter question

2010-04-09 Thread Martin Gainty
que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni. Date: Fri, 9 Apr 2010 19:02:33 +0200 From: cars...@bitbybit.dk To: mgai...@hotmail.com CC: mysql@lists.mysql.com Subject: Re: DATE_FORMAT parameter

Date sorting problem with Date_Format?

2008-02-08 Thread mikesz
Hello mysql, I have a PHP script that is running the following query: SELECT `Messages`.`ID`, `Messages`.`Sender`, `Messages`.`Subject`, DATE_FORMAT( `Messages`.`Date`, '%D %M %Y' ) AS Date, LEFT(`Messages`.`Text`, 200 ) AS Preview, `Messages`.`New`, `Profiles`.`NickName`, `Profiles`.`RealName

Re: Date sorting problem with Date_Format?

2008-02-08 Thread mikesz
Hello mysql list, As is very often the case, five minutes after I posted this, I found the problem or solution, not sure it was the problem as I am not convinced that mysql ought to get confused so easily. I changed DATE_FORMAT( `Messages`.`Date`, '%D %M %Y' ) AS Date, DATE_FORMAT( `Messages

RE: select date_format('2004-10-03 15:06:14','%m/%d/%y %T');

2005-03-09 Thread Stembridge, Michael
RE: Import Access Data... I'll try and import using ODBC. Is there any good web sites about ODBC and its operations that I can learn about it? Scott If you haven't found this by now: http://forums.mysql.com/list.php?65 - MySQL forum for Access conversion. Many people use ODBC to migrate

RE: select date_format('2004-10-03 15:06:14','%m/%d/%y %T');

2005-03-08 Thread Gordon
date_format('2004-10-03 15:06:14','%m/%d/%y %T'); How do I create a table using: date_format('2004-10-03 15:06:14','%m/%d/%y %T'); That way I can import Access Data? -- Power to people, Linux is here. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http

Re: select date_format('2004-10-03 15:06:14','%m/%d/%y %T');

2005-03-07 Thread Scott Hamm
Thanks! I'll try and import using ODBC. Is there any good web sites about ODBC and its operations that I can learn about it? Scott On Mon, 07 Mar 2005 09:26:56 +1100, Daniel Kasak [EMAIL PROTECTED] wrote: Scott Hamm wrote: How do I create a table using: date_format('2004-10-03 15:06:14

Re: select date_format('2004-10-03 15:06:14','%m/%d/%y %T');

2005-03-06 Thread Daniel Kasak
Scott Hamm wrote: How do I create a table using: date_format('2004-10-03 15:06:14','%m/%d/%y %T'); That way I can import Access Data? Can't do that. You can import Access data via ODBC - that way the driver figures out how to send the data to MySQL. I assume you are trying to export to a text

select date_format('2004-10-03 15:06:14','%m/%d/%y %T');

2005-03-04 Thread Scott Hamm
How do I create a table using: date_format('2004-10-03 15:06:14','%m/%d/%y %T'); That way I can import Access Data? -- Power to people, Linux is here. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

DATE_FORMAT DISTINCT

2004-07-12 Thread Terry Riley
BY fixturedate which works fine, and I'm able to output the result of the SQL without problem. If that query is changed to: SELECT DISTINCT fixturedate, MONTH(fixturedate) AS CalMonth, DATE_FORMAT(fixturedate, '%d a%') AS testing FROM Fixtures ORDER BY fixturedate Coldfusion tells me

Date_Format

2004-02-20 Thread Jacque Scott
I have the following query where the user will put in a date. They will put it in like '01/01/04'. I use this date in my WHERE clause but MySQL needs the date like '2004/01/01'. I tried using Date_Format('04/01/01', '%Y-%m-%d') to change the way it is formatted but I don't get the correct data

Re: Date_Format

2004-02-20 Thread David Griffiths
If you need the date like, '2004/01/01', then shouldn't it be '%Y/%m/%d'? You still ahve the dashes (the '-' character) in your date-format, and you need a forward-slash (the '/' character) instead. Here's what I ran on MySQL: mysql select date_format(NOW(), '%Y/%m/%d

Issue with DATE_FORMAT() call returning wrong year

2004-01-05 Thread PAUL MENARD
Hello all, I have a query that for some reason is now returning the incorrect year. First here is my server configuration. Windows 2003 Advanced server MySQL version 4.0.15-nt Here is my SQL statement: SELECT DATE_FORMAT(E.DateTime, '%X-%m-%d %h:%i:%s %p' ) AS DateTime, E.SendCount

RE: Issue with DATE_FORMAT() call returning wrong year

2004-01-05 Thread stairwaymail-mysql
Try %Y instead of %X -Original Message- From: PAUL MENARD [mailto:[EMAIL PROTECTED] Sent: Monday, January 05, 2004 10:08 AM To: [EMAIL PROTECTED] Subject: Issue with DATE_FORMAT() call returning wrong year Hello all, I have a query that for some reason is now returning the incorrect

RE: Issue with DATE_FORMAT() call returning wrong year

2004-01-05 Thread PAUL MENARD
: Issue with DATE_FORMAT() call returning wrong year Hello all, I have a query that for some reason is now returning the incorrect year. First here is my server configuration. Windows 2003 Advanced server MySQL version 4.0.15-nt Here is my SQL statement: SELECT DATE_FORMAT(E.DateTime, '%X-%m

date_format and DECODE Problem

2003-12-15 Thread Raimond X
Hi, i have a problem with getting the right return values from field purrdato. All records exept a few are set with date and the rest is NULL. The field allows Null values. when using: DATE_FORMAT(purrdato, '%d.%m.%Y') AS purrdato ...it even returns '00.00.' on null values

date_format, distinct and binary chars

2003-11-19 Thread tjkuhn
Okay, here's an interesting one. Here's the query: SELECT distinct date_format(auditdate, %Y%M ) as listUrl, date_format( auditdate, %Y%m ) as blank FROM quality_history WHERE auditdate Now() ORDER BY listUrl desc LIMIT 6 auditdate is a DATE datatype When I run

date_format function - German

2003-10-22 Thread Steve Vernon
Hello, I have read and searched the internet, but I cannot find much on getting mysql to return German and other languages months. Is there codes you use? I really would prefer to use the English MySQL (if there is such a one) as I don't know much German, and need the error messages in English!

Re: date_format function - German

2003-10-22 Thread Bernhard Döbler
Look in your my.ini file. There's maybe an entry: language=f:/mysql/share/german Set it to your favourit language! Bernhard - Original Message - From: Steve Vernon [EMAIL PROTECTED] To: Mysql List [EMAIL PROTECTED] Sent: Wednesday, October 22, 2003 4:47 PM Subject: date_format

Re: date_format function - German

2003-10-22 Thread Henning Heil
Hello Steve, Steve Vernon wrote on 22.10.2003 16:47 I suppose I could return the month as a number, and then output the text from that, but this seems a bit tacky! I think that's the most reliable way, imagine you move to a new server or install your software somewhere else . . . I

attempting to use DATE_FORMAT function in a SELECT STATEMENT

2002-11-30 Thread Nicole Lallande
I am trying to format a TIMESTAMP column on output by using the DATE_FORMAT() function: Can someone tell me why this does not change the format - no error message - just does not do anything? $sql = SELECT * from arviContacts WHERE fid=$zz AND DATE_FORMAT(date_rec,'%Y-%m-%d %T'); I have also

Re: attempting to use DATE_FORMAT function in a SELECT STATEMENT

2002-11-30 Thread Nicole Lallande
Thanks very much Robert, that worked. I was surprised at the effect of the '*'. Best regards, Nicole Robert Kostko wrote: Hi, Nicole IMHO after * all additional field statements DATE_FORMAT(date_rec,'%Y-%m-%d %T') are ignored. Try to list all neccessary fields after SELECT and give

Incorrect DATE_FORMAT output for weeks with year e.g. '%v-%y'

2002-11-21 Thread Joe Siegrist
): SELECT DATE_FORMAT('2001-12-25', '%v-%y'); ++ | DATE_FORMAT('2001-12-25', '%v-%y') | ++ | 52-01 | ++ SELECT DATE_FORMAT('2001-12-31', '%v-%y

RE: Incorrect DATE_FORMAT output for weeks with year e.g. '%v-%y'

2002-11-21 Thread Luc Foisy
year ( xx-01 is right ) Here's the an example (the second one is not what I'd expect): SELECT DATE_FORMAT('2001-12-25', '%v-%y'); ++ | DATE_FORMAT('2001-12-25', '%v-%y') | ++ | 52-01

Re: Incorrect DATE_FORMAT output for weeks with year e.g. '%v-%y'

2002-11-21 Thread Joe Siegrist
you increment the year as well? SELECT DATE_FORMAT('2001-12-31', '%v-%y'); returning '01-01' is inaccurate to say the least. %x and %X have the same problem as %v (since they use it). Don't really know how you would use them with each other to get the right date, but you must be able to do

Re: Incorrect DATE_FORMAT output for weeks with year e.g. '%v-%y'

2002-11-21 Thread Andy Bakun
it would be '01', but if you wrap the week number, you shouldn't you increment the year as well? SELECT DATE_FORMAT('2001-12-31', '%v-%y'); returning '01-01' is inaccurate to say the least. mysql select DATE_FORMAT('2001-12-31', '%v-%y'); +---+ | DATE_FORMAT

reverse date_format problem

2002-10-22 Thread Andrew Braithwaite
Hello All, I want to convert the string '18 October 2002' to the date format '2002-10-18' using MySQL. Essentially this is the reverse of the DATE_FORMAT(date,format) function. I'm pretty sure it can't be done but does anyone out there have any ideas? Thanks, Andrew sql,query

DATE_FORMAT PROBLEM

2002-10-03 Thread Mark Colvin
, d1.width, DATE_FORMAT(d1.created, '%d-%m-%Y'), DATE_FORMAT(d1.amended, '%d-%m-%Y'), d2.extdescr from decheader as d1, decextdescr as d2 where d1.code = d2.code and d1.code = '00042' The problem I am having is with the DATE_FORMAT. Running the above query returns the following for the ‘width

Re: DATE_FORMAT PROBLEM

2002-10-03 Thread Keith C. Ivey
On 3 Oct 2002, at 15:33, Mark Colvin wrote: The problem I am having is with the DATE_FORMAT. Running the above query returns the following for the ‘width’ column. 94.40 DATE_FORMAT(d1.created, '%d-%m-%Y'): NULL DATE_FORMAT(d1.amended, '%d-%m-%Y'): 03-10-2002 Show your PHP code. How

Date_Format

2002-09-05 Thread Chuck \PUP\ Payne
Hi, This might be a strange question, but can you do date_format when you do a myrow? Or does date_format as always have to be done in a sql statement? Does anyone have an easy of doing dates? Chuck Payne Magi Design and Support

Re: Core dump: date_format('%b') with corupted data

2002-06-14 Thread Egor Egorov
Radoslaw, Thursday, June 13, 2002, 4:03:08 PM, you wrote: RK I run mysql3.23.49/myisam with linux 2.4.18/libc2.2.5. RK Some time ago I've hardware crash. Myisamchk didn't report RK any problems but after some time mysql got SIGSEGV. [skip] Can you send me binary files of your table for

Core dump: date_format('%b') with corupted data

2002-06-13 Thread Radoslaw Karas
Hi I run mysql3.23.49/myisam with linux 2.4.18/libc2.2.5. Some time ago I've hardware crash. Myisamchk didn't report any problems but after some time mysql got SIGSEGV. From that time mysql finished with SIGSEGV in the same place a few times. 0x80cb554 handle_segfault__Fi + 428 0x40021f54 _end +

date_format question

2002-05-22 Thread Lee P Reilly
Hi, I have a quick question concerning date/time functions. If I query MySQL: SELECT date_format(date, '%W %M %e %Y') FROM experiments where expid=3706 It returns: Wednesday May 2 1979 Are there existing methods for determining whether to add st, nd or rd after the %e? e.g

RE: date_format question

2002-05-22 Thread Gurhan Ozen
Subject: date_format question Hi, I have a quick question concerning date/time functions. If I query MySQL: SELECT date_format(date, '%W %M %e %Y') FROM experiments where expid=3706 It returns: Wednesday May 2 1979 Are there existing methods for determining whether to add st, nd or rd

Re: Problem with MySQL DATE_FORMAT or is it a PEBKAC??

2002-01-31 Thread DL Neil
Neil, I appear to be having an error with the following update that I am submitting to my database. I am using mysql's DATE_FORMAT function to pull the date out and insert in a user friendly form. Upon submission of the modified data, I use the below SQL to update the table information

Problem with MySQL DATE_FORMAT or is it a PEBKAC??

2002-01-30 Thread Neil Silvester
I appear to be having an error with the following update that I am submitting to my database. I am using mysql's DATE_FORMAT function to pull the date out and insert in a user friendly form. Upon submission of the modified data, I use the below SQL to update the table information. Everything

Re: date_format

2001-12-31 Thread julian haffegee
find no mention. Am I searching for the wrong thing? I searched for AS in the documentation thanks again Jules You may want to try: $result = mysql_query(SELECT title, description, url, author, date_format(datefield, '%M %D %Y') AS datefield FROM documents

Re: date_format

2001-12-31 Thread Admin
- Original Message - From: julian haffegee [EMAIL PROTECTED] To: MySQL General List [EMAIL PROTECTED] Sent: Monday, December 31, 2001 2:55 PM Subject: Re: date_format Thanks this works the difference was the 'AS datefield' what is this bit doing? I searched for AS (in the SELECT

date_format

2001-12-30 Thread julian haffegee
on the web/books suggests that this is what to do $result = mysql_query (SELECT title, description, url, author, date_format(datefield, %M %D %Y') FROM documents); This just leaves out all dates. Can anyone see where I'm going wrong Thank you so much Jules

RE: date_format

2001-12-30 Thread Chris Bolt
#2 All I have read on the web/books suggests that this is what to do $result = mysql_query (SELECT title, description, url, author, date_format(datefield, %M %D %Y') FROM documents); This just leaves out all dates. You may want to try: $result = mysql_query(SELECT title, description

Re: date_format doesn't work correct

2001-07-20 Thread Florian Schmidt
-07-16 14:00:00' ^ exactly this is the bug! the date at this time was: '2001-07-19 14:00:00' and now() correctly reports this, but a date_format(now(), '%Y%m%d%H') says '2001071614' with 16 as the month-day instead of 19 which would be right !? -- Florian Schmidt

date_format doesn't work correct

2001-07-19 Thread Florian Schmidt
Hi! i've mysql-3.23.39-nt on winnt with a client running under SCO 3.2 i've a simple querry with date_format in it, but date_format isn't doing what i expect... sql_string: select date_format(c.hour, '%Y%m%d%H'), c.hour from count c c.hour is DATETIME okay, i see this output on my sco

RE: date_format doesn't work correct

2001-07-19 Thread Florian Schmidt
At 09:25 19.07.2001 -0400, you wrote: Probably due to timezone setting differences between the two client machines. i also thought about that, but there are 2 DAYs difference... can this be a timezone issue ? okay, i see this output on my sco-machine: '2001071614' '2001-07-19 14:00:00' if i

RE: date_format doesn't work correct

2001-07-19 Thread Florian Schmidt
At 09:40 19.07.2001 -0400, you wrote: You're correct, likely not a timezone problem. Have you confirmed that the clocks on these machines are synchronized? That they aren't really three days off? yep, again and agein :) the clocks are in sync +/- 5 secs okay, i see this output on my

Displaying MySQL database with DATE_FORMAT

2001-06-01 Thread Tim Thorburn
Hi, I've developed a simple search engine for a site I'm working on. Its purpose is to display community events based on the users input criteria. The problem is, if I use the DATE_FORMAT command to alter the appearance of the events dates and times - then MySQL begins at the top of the list

Re: Displaying MySQL database with DATE_FORMAT

2001-06-01 Thread Eric Fitzgerald
I think your doing FAR more work than you need to. I'm also not getting what you mean by it not paying attention to the initial query. I suggest you combine those 3 queries into one, just like this: SELECT somefield1, somefield2, DATE_FORMAT(EventStartDate, '%W %M %D %Y

[MySQL] DATE_FORMAT

2001-05-29 Thread Tim Thorburn
like to display them in a more user friendly format. For example, there is an event taking place this Wednesday, in ISO 2001-05-30 - I'd like it to display as May 30th, 2001. Through the command line, I know I do this by typing: select DATE_FORMAT(EventStartDate, '%M %D %Y'); My question

Re:[MySQL] DATE_FORMAT

2001-05-29 Thread Sam Masiello
Hi Tim! You could do something like this: $sqlstr = select date_format(EventStartDate, '%M %D %Y') as mydate, (rest of your SQL string here) ; $result = mysql(mydb, $sqlstr, $connect) ; $myformatteddate = mysql_result($result, 0, 'mydate') ; This should do it for you :) HTH

RE: [MySQL] DATE_FORMAT

2001-05-29 Thread Patrick Calkins
$Result = @mysql_query (SELECT DATE_FORMAT(EventStartDate,'%M %D %Y') AS EventStartDate FROM EventsTable); $Row = mysql_fetch_array($Result); printf(Event Date:%s, %Row['EventStartDate']; Hope this helps :o) --Patrick # -Original Message- # From: Tim Thorburn [mailto:[EMAIL PROTECTED

Re: [MySQL] DATE_FORMAT

2001-05-29 Thread Paul DuBois
in my database are ISO format, so -MM-DD, I'd like to display them in a more user friendly format. For example, there is an event taking place this Wednesday, in ISO 2001-05-30 - I'd like it to display as May 30th, 2001. Through the command line, I know I do this by typing: select DATE_FORMAT

Nesting DATE_FORMAT

2001-05-29 Thread Steven Wren
to do: SELECT whatever FROM tbl1, tbl2 WHERE ( tbl1.registration_date = DATE_FORMAT(now(),'%Y-%m-)DATE_FORMAT(tbl2.registration_date,'%d') AND tbl1.registration_date = DATE_FORMAT(now(),'%Y-%m-%d') ) AND tbl2.id=1000 So both tables have their own registration_date, and I am trying to display rows

Re: date_format sets time to 12:00:00

2001-05-19 Thread Sinisa Milivojevic
Paul Schreiber writes: Sinisa Milivojevic wrote: cut Column start is of type TIME. The actual values are illustrated above in the example. Paul Hi! Then it is not a bug. As our manual clearly points out, date_format can be used only on date and datetime column types. Regards

Re: date_format sets time to 12:00:00

2001-05-18 Thread Paul Schreiber
Sinisa Milivojevic wrote: [EMAIL PROTECTED] writes: Description: date_format is setting times to 12:00 AM; time_format works fine How-To-Repeat: mysql select start,TIME_FORMAT(start, '%l:%i %p') AS start2 FROM time; +--+--+ | start| start2

date_format sets time to 12:00:00

2001-05-17 Thread pjschrei
Description: date_format is setting times to 12:00 AM; time_format works fine How-To-Repeat: mysql select start,TIME_FORMAT(start, '%l:%i %p') AS start2 FROM time; +--+--+ | start| start2 | +--+--+ | 12:00:00 | 12:00 PM | | 14:00:00 | 2:00 PM

Re: Date_format - can't get it..

2001-04-11 Thread David Bouw
with the name ID and a datetime column named DATE.. But you are right that it is probably reserved for some stuff.. The DATE_FORMAT can indeed be left out, but I once understood that this was more save to do..??? I never asked why, but also never had any problems.. I found the source of my problem

Date_format - can't get it..

2001-04-10 Thread David Bouw
((perfect_customer_productorders.date) = DATE_FORMAT( DATE_SUB( NOW() , INTERVAL 30 DAY ) , '%Y-%m-%d' ) and perfect_customer_productorders.ordernr = 'te-004' and perfect_customer_orders.status != 2) GROUP BY perfect_customer_productorders.ordernr ORDER BY quantity desc - This is the trouble maker

Re: date_format

2001-01-17 Thread Pavel Kveton
On Wednesday 17 January 2001 00:20 Cindy wrote: OK. I went to the documentation at www.mysql.com and typed in DATE_FORMAT in the search box, hopefully find a list of the %M's, etc rules that may be used (I'd like December to become Dec, etc). No dice. Randomly looking through sections

Re: date_format

2001-01-17 Thread skip
Jan 2001, Pavel Kveton wrote: On Wednesday 17 January 2001 00:20 Cindy wrote: OK. I went to the documentation at www.mysql.com and typed in DATE_FORMAT in the search box, hopefully find a list of the %M's, etc rules that may be used (I'd like December to become Dec, etc). No dice

Re: date_format

2001-01-17 Thread Cindy
, etc. I would really like a complete list of the available %'s in this function. I thank you all for your help, but I still think that entering DATE_FORMAT in the documentation search box at www.mysql.com should have been successful. (I'm specifically looking for a way to display Dec for 12

RE: date_format

2001-01-17 Thread Scott Gerhardt
Hello Cindy, I posted this in response to another date formatting question, hope it helps. The link should be helpful if you haven't found it already. SELECT fields, DATE_FORMAT(datefield, '%M %d, %Y'); I just looked it up myself...It's all in the manual at: http://www.mysql.com/doc/D

Re: date_format

2001-01-16 Thread Jason Brooke
Try the manual contents, linked from the documentation page http://www.mysql.com/documentation/mysql/bychapter OK. I went to the documentation at www.mysql.com and typed in DATE_FORMAT in the search box, hopefully find a list of the %M's, etc rules that may be used (I'd like December