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

Home » Imported messages » comp.lang.php » Putting it all together
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: Storing dates [message #186245 is a reply to message #186244] Sat, 21 June 2014 19:04 Go to previous messageGo to previous message
Jrgen Exner is currently offline  Jrgen Exner
Messages: 14
Registered: March 2013
Karma:
Junior Member
On Sat, 21 Jun 2014 14:28:47 -0400, richard <noreply(at)example(dot)com> wrote
in comp.databases.mysql:

> On Sat, 21 Jun 2014 17:42:29 +0000 (UTC), Doug Miller wrote:
>
>> richard <noreply(at)example(dot)com> wrote in news:1mddkhwt2mr0v$.1m6eithcu7iod.dlg@
>> 40tude.net:
>>
>>> As for the date usage on MY database tables, I am only using a date as a
>>> reference.
>>
>> Patently false, as you have posted questions here asking for help resolving your problems in
>> sorting by the date.
>>
>>> I really don't give a damn what your philosophy or ideals are
>>> behind the so called "proper ways" of obtaining a date.
>>
>> Which is exactly *why* you have problems sorting by the date.
>
> The problem with sorting is, it treats any value given as a string, then
> determines which has the lowest value in total.
> 1
> 2
> 3
> 10
> 20
> 30
> 100
> 200
> 300

A normal ascending numerical sort

> When you sort these numbers, how do they get displayed?
> You will most likely see them displayed as:
> 1
> 10
> 100
> 2

A normal ascending alphabetical sort

> Or maybe even as
> 100
> 10
> 1
> 2

This looks rather strange. Even if there were a trailing space character
then still "10 " would be sorted before "100 ". What sorting is this?

> In Liberty BASIC I got (as strings)
> 1
> 10
> 100
> 2
> 20
> 200
> 3
> 30
> 300

Again, a standard alphabetical sort.

So, which sorting order do you want? Numerical or alphabetical? And is
your data stored as number or as string? And if the type doesn't match
then what happened when you cast it into the right data type?

jue
[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
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
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: str_replace does not like empty quotes
Next Topic: SplFileObject always returns an extra "last" line -- why?
Goto Forum:
  

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

Current Time: Mon Nov 25 00:04:33 GMT 2024

Total time taken to generate the page: 0.04583 seconds