FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » How to loop through the dates?
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: How to loop through the dates? [message #186152 is a reply to message #186145] Mon, 16 June 2014 18:14 Go to previous messageGo to previous message
Lew Pitcher is currently offline  Lew Pitcher
Messages: 60
Registered: April 2013
Karma:
Member
On Monday 16 June 2014 12:26, in comp.lang.php, "richard"
<noreply(at)example(dot)com> wrote:

> On Sun, 15 Jun 2014 19:14:22 -0400, Lew Pitcher wrote:
>
>> On Sunday 15 June 2014 13:40, in comp.lang.php, "Denis McMahon"
>> <denismfmcmahon(at)gmail(dot)com> wrote:
>>
>>> On Sun, 15 Jun 2014 12:11:01 -0400, richard wrote:
>>>
>>>> Data is ordered by date.
>>>
>>> See, this is where the richard database design starts to bite the
>>> richard arse.
>>>
>>> You are storing dates as a string representation of the date, so your
>>> "order by date" sql clause causes the data to be ordered according to
>>> the string collation for the relevant table.
>>>
>>> If you want the mysql rdbms to sort the data into date sequence, then
>>> you need to store the data as dates.
>>
>> That's good advice (the best).
>>
>> However, richard can get away with
>> SELECT * FROM table ORDER BY STR_TO_DATE(date,date_string_format);
>>
>> That will convert his string dates to "real" dates for the purposes of
>> ordering the resultset rows, and should come out in ascending sequence by
>> calendar date.
[snip]
> What is it with you people over this damn date issue?

Richard. I *DON'T CARE* about your "date issue". But, you apparently do,
since *YOU* asked how to get your data into date sequence.

Since you don't seem to appreciate the help you get, all I can say is....

PLONK

--
Lew Pitcher
"In Skills, We Trust"
PGP public key available upon request
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: What is the purpose of "&" in this code?
Next Topic: why is it always an endless loop?
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Thu Nov 28 13:39:52 GMT 2024

Total time taken to generate the page: 0.04470 seconds