For Programmers: Free Programming Magazines  


Home > Archive > PHP SQL > February 2008 > WHERE (06/06/1978 < 06/06/1979) returns false ?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author WHERE (06/06/1978 < 06/06/1979) returns false ?
Skybuck Flying

2008-01-06, 8:03 am

WHERE (06/06/1978 < 06/06/1979) returns false ?

Clearly 1978 is smaller than 1979 ?

These are dates...

Why is the comparision failing ?

Bye,
Skybuck.


Danny Strümpel

2008-01-06, 8:03 am

Skybuck Flying schrieb:
> WHERE (06/06/1978 < 06/06/1979) returns false ?


Stick to the subject. This is not a SQL group.

--
Military intelligence is a contradiction in terms.
-- Groucho Marx

....und wech
Danny <dannys9 (at) gmx (dot) de>
Nicholas Sherlock

2008-01-06, 8:03 am

Skybuck Flying wrote:
> WHERE (06/06/1978 < 06/06/1979) returns false ?
>
> Clearly 1978 is smaller than 1979 ?
>
> These are dates...


BUT, is 5.0556e-4 smaller than 5.0530-4? NO.

Nicholas Sherlock
Skybuck Flying

2008-01-06, 8:03 am

Maybe quotes are needed,

So far this seems to be working:

AND (''06/06/1978'' < ''06/06/1979'')

I'll try using quotes one more time ;)

Bye,
skybuck.


Skybuck Flying

2008-01-06, 8:03 am

Nope, not working:

(Birthday <> null) AND
(Birthday > '06/06/1978') AND
(Birthday < '06/06/1979')

Bye,
Skybuck.


Skybuck Flying

2008-01-06, 8:03 am

You need to:

1. XXXX off

2. Get a clue what the problem is.

Because you have no idea what the problem is, It could be a Delphi problem
it could be wrong SQL statement.

More information will follow relating to delphi if the problems is not
solved with correct sql statements.

Bye,
Skybuck.


Skybuck Flying

2008-01-06, 8:03 am

Besides DIPSHIT,

Delphi is a PRODUCT FOR DATABASE DEVELOPMENT.

It's not that far OFF.

PHP-SQL
DELPHI-SQL

LOTS OF OVERLAP.

Besides there is no SQL ONLY NEWSGROUP.

Bye,
Skybuck.


Skybuck Flying

2008-01-06, 8:03 am

To all others I say:

EXCUSE ME FOR MY FILTHY LANGUAGE.

BUT SOME ASSHOLES BEEN STALKING ME ON THE DELPHI NEWSGROUP FOR THESE LAST
FEW DAYS.

They need some harsh language to get them to XXXX off.

Bye,
Skybuck.


Nicholas Sherlock

2008-01-06, 8:03 am

Skybuck Flying wrote:
> Maybe quotes are needed,
>
> So far this seems to be working:
>
> AND (''06/06/1978'' < ''06/06/1979'')
>
> I'll try using quotes one more time ;)


How is it supposed to know that the text you've provided forms a date?
It doesn't look any different to any other string. In MySQL, dates are
formatted like 2007-01-01, without quotes. In Oracle, you use a to_date
function to convert a string with a format that you supply to a date.

Every database provider has a slightly different flavor. SQL questions
should go to the DBMS provider's forums.

Nicholas Sherlock
Danny Strümpel

2008-01-06, 8:03 am

Skybuck Flying schrieb:
> EXCUSE ME FOR MY FILTHY LANGUAGE.
>
> BUT SOME ASSHOLES BEEN STALKING ME ON THE DELPHI NEWSGROUP FOR THESE LAST
> FEW DAYS.


YOU are the XXXXXXX around here and are stalking everyone for over
years. Get it into your mind, that this is the reason why now everyone
strikes back. YOU ARE THE PROBLEM, NOT WE!

> More information will follow


Don't let any information follow anymore. Get a life and shut up at last.

--
Spend extra time on hobby. Get plenty of rolling papers.

....und wech
Danny <dannys9 (at) gmx (dot) de>
Skybuck Flying

2008-01-06, 8:03 am

YOU ARE THE XXXXXXX YOU DO NOTHING BUT NAG ABOUT ME

PLONK.

IF YOU KEEP THAT UP YOU MIGHT BE THE FIRST PERSON IN HISTORY TO END UP ON MY
KILLFILE.

UNTIL NOW I HAVE BE VERY TORELANT AGAINST TROLLS AND ASSHOLES LIKE YOU AND
JIM.

Mostly for my own entertainment but now I want to develop something and your
nagging is no longer required for my entertainment purposes.

You should look at yourself and what you are doing and don't listen to what
other says.

Just because others say that I spam or whatever doesn't give you the right
to start hitting on me.

I am not even sure if that is the reason why you do this and I don't care
what the reason is.

All I see you do is nag, nag, nag, nag ABOUT ME !

I NAG ABOUT BUGS AND STUFF THERE IS A DIFFERENCE.

Bye,
Skybuck.

Actually I am going to killfile you right now because I am done.


Skybuck Flying

2008-01-06, 8:03 am

I am gonna give you a 4 w ban ;)

Because you nagged a lot.

But you also wrote some stuff about Delphi.

After 4 ws I shall remove you from the killfile and see how you do.

Bye,
Skybuck :)








Danny Strümpel

2008-01-06, 8:03 am

Skybuck Flying schrieb:
> All I see you do is nag, nag, nag, nag ABOUT ME !


Now the little boy is crying, awh!

> I NAG ABOUT BUGS AND STUFF THERE IS A DIFFERENCE.


Yes, you never get personal.

--
"Sage nicht ja, bevor ich zuende gesprochen habe."
-- Darryl F. Zanuck

....und wech
Danny <dannys9 (at) gmx (dot) de>
Rudy Velthuis

2008-01-06, 8:03 am

Skybuck Flying wrote:

> To all others I say:
>
> EXCUSE ME FOR MY FILTHY LANGUAGE.
>
> BUT SOME ASSHOLES BEEN STALKING ME ON THE DELPHI NEWSGROUP FOR THESE
> LAST FEW DAYS.


You deserve it. You have been terrorizing this group for ages with the
inane junk you post, while gratuitously insulting people along the line.

And yes, please, "ban" me too. Not 4 ws, forever.
--
Rudy Velthuis http://rvelthuis.de

"We don't like their sound, and guitar music is on the way out."
-- Decca Recording Co. rejecting the Beatles, 1962
Rudy Velthuis

2008-01-06, 8:03 am

Skybuck Flying wrote:

> After 4 ws I shall remove you from the killfile and see how you do.


LOL! Who cares?
--
Rudy Velthuis http://rvelthuis.de

"Mit der Dummheit kämpfen Götter selbst vergebens"
"Against stupidity the (very) gods themselves contend in vain"
-- Friedrich von Schiller
Danny Strümpel

2008-01-06, 8:03 am

Rudy Velthuis schrieb:
> You deserve it. You have been terrorizing this group for ages with the
> inane junk you post, while gratuitously insulting people along the line.


Oh-oh, remember he's a researcher, discussing only advanced,
experimental, scientific code. <eg>

--
Real software engineers don't debug programs, they verify correctness.
This process doesn't necessarily involve execution of anything on a
computer, except perhaps a Correctness Verification Aid package.

....und wech
Danny <dannys9 (at) gmx (dot) de>
Skybuck Flying

2008-01-06, 7:04 pm

As you wish.

No more name calling from you :)

Bye,
Skybuck.


Skybuck Flying

2008-01-06, 7:04 pm

The finally code would have looked something like:

(Birthdate < '06/06/1979')

Since Birthdate is a date field the SQL interpreter could have known the
string should contain a date.

Anything else would not make any sense ?!?

Bye,
Skybuck.



Jim P

2008-01-06, 7:04 pm

Danny Strümpel wrote:
> Skybuck Flying schrieb:
>
> YOU are the XXXXXXX around here and are stalking everyone for over
> years. Get it into your mind, that this is the reason why now everyone
> strikes back. YOU ARE THE PROBLEM, NOT WE!
>
>
> Don't let any information follow anymore. Get a life and shut up at last.
>

sooner or later - - - -

a person has to realize that if they whole world is against him
that all are saying the same thing about him - - -

that there might some truth to what is being said.

we are tired of you and your stuff - - -

listen and learn - - -

take your med's

it is not one saying this - - - it is all - - - -
you are the only one thinking differently - - - -

you are the problem - - -

Jim P.
Jim P

2008-01-06, 7:04 pm

Rudy Velthuis wrote:
> Skybuck Flying wrote:
>
>
> LOL! Who cares?

very true

why not ban yourself and make all happy

and then you will not have to put up with abuse from us
as we return what you give

Jim P
Jim P

2008-01-06, 7:04 pm

Skybuck Flying wrote:
> The finally code would have looked something like:
>
> (Birthdate < '06/06/1979')
>
> Since Birthdate is a date field the SQL interpreter could have known the
> string should contain a date.
>

Why?

> Anything else would not make any sense ?!?
>
> Bye,
> Skybuck.
>
>
>

David Kerber

2008-01-07, 7:07 pm

In article <15e0d$4780a0b4$541983fa$1580@cache3.tilbu1.nb.home.nl>,
spam@hotmail.com says...
> Maybe quotes are needed,
>
> So far this seems to be working:
>
> AND (''06/06/1978'' < ''06/06/1979'')
>
> I'll try using quotes one more time ;)


It's comparing them as strings, not dates. If you put them in the
format yyyy-mm-dd, either one will work.

--
Remove the ns_ from if replying by e-mail (but keep posts in the
newsgroups if possible).
David Kerber

2008-01-07, 7:07 pm

In article <b7e77$4780f24d$541983fa$15576@cache5.tilbu1.nb.home.nl>,
spam@hotmail.com says...
> The finally code would have looked something like:
>
> (Birthdate < '06/06/1979')
>
> Since Birthdate is a date field the SQL interpreter could have known the
> string should contain a date.


Or did it think you wanted to convert the date to a string and compare
as strings? It has no way of knowing what you want.

>
> Anything else would not make any sense ?!?


--
Remove the ns_ from if replying by e-mail (but keep posts in the
newsgroups if possible).
vbasic55

2008-02-12, 8:06 am

Ummm... just guessing here because I'm a noob to PHP and to a lesser extent,
sort of a noob to MySQL.

I would suspect that your dates aren't being recognized as dates at all, but
rather, as expressions containing some integers and the slashes are being
interpreted as operators - so the larger the right-hand divisor, the smaller
the result will be.

Thus your statement WHERE (06/06/1978 < 06/06/1979) will be false.

With MySQL I think the proper syntax would be 'YYYY-MM-DD' to pass a
literal date as a parameter. With PHP dates seem to be oriented around the
UNIX timestamp and most of the code I've done/seen so far approaches dates
as either the Unix timestamp or as a formatted string generated by coercing
the timestamp or the time() function into printable text.

Again this is just the comments of a noob so your results may vary.

V



"Skybuck Flying" <spam@hotmail.com> wrote in message
news:a14ce$47809de4$541983fa$9723@cache5
.tilbu1.nb.home.nl...
> WHERE (06/06/1978 < 06/06/1979) returns false ?
>
> Clearly 1978 is smaller than 1979 ?
>
> These are dates...
>
> Why is the comparision failing ?
>
> Bye,
> Skybuck.
>


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com