Welcome to dbForumz.com!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

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

 
Goto page Previous  1, 2
   Database Forums (Home) -> PHP SQL RSS
Next:  SQL needs AGE function.  
Author Message
Zathras

External


Since: Jan 06, 2008
Posts: 1



(Msg. 16) Posted: Sun Jan 06, 2008 10:59 am
Post subject: Re: WHERE (#06/06/1978# < #06/06/1979#) works in MS Access. Problem solved ;) [Login to view extended thread Info.]
Archived from groups: alt>comp>lang>borland-delphi, others (more info?)

On Sun, 6 Jan 2008 12:35:16 -0000, "Paul Lautman"
wrote:

>Have you ever considered reading a manual?

Do a search on Usenet and you'll find that is a question often put to
the infamous Skybuck. He prefers people to do his work for him and
then calls it collaboration.

--
Z

 >> Stay informed about: WHERE (06/06/1978 06/06/1979) returns false ? 
Back to top
Login to vote
Skybuck Flying

External


Since: Jan 06, 2008
Posts: 16



(Msg. 17) Posted: Sun Jan 06, 2008 10:59 am
Post subject: Re: WHERE (06/06/1978 < 06/06/1979) returns false ? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

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.

 >> Stay informed about: WHERE (06/06/1978 06/06/1979) returns false ? 
Back to top
Login to vote
Jim P

External


Since: Jan 06, 2008
Posts: 5



(Msg. 18) Posted: Sun Jan 06, 2008 12:01 pm
Post subject: Re: WHERE (06/06/1978 < 06/06/1979) returns false ? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Rudy Velthuis wrote:
> Skybuck Flying wrote:
>
>> After 4 weeks I shall remove you from the killfile and see how you do.
>
> 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
 >> Stay informed about: WHERE (06/06/1978 06/06/1979) returns false ? 
Back to top
Login to vote
Jim P

External


Since: Jan 06, 2008
Posts: 5



(Msg. 19) Posted: Sun Jan 06, 2008 12:04 pm
Post subject: Re: WHERE (#06/06/1978# < #06/06/1979#) works in MS Access. Problem [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Skybuck Flying wrote:
> For something as simple as comparing dates: no.
>
> Bye,
> Skybuck.
>
>
but then you would have the answer instead of making us your manual.

Jim P.
 >> Stay informed about: WHERE (06/06/1978 06/06/1979) returns false ? 
Back to top
Login to vote
Jim P

External


Since: Jan 06, 2008
Posts: 5



(Msg. 20) Posted: Sun Jan 06, 2008 12:05 pm
Post subject: Re: WHERE (06/06/1978 < 06/06/1979) returns false ? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

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.
>
>
>
 >> Stay informed about: WHERE (06/06/1978 06/06/1979) returns false ? 
Back to top
Login to vote
Paul Lautman

External


Since: Feb 28, 2006
Posts: 55



(Msg. 21) Posted: Sun Jan 06, 2008 2:00 pm
Post subject: Re: WHERE (#06/06/1978# < #06/06/1979#) works in MS Access. Problem solved ;) [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Skybuck Flying wrote:
> For something as simple as comparing dates: no.
>
> Bye,
> Skybuck.

You obviously aren't finding it that simple. Using the manual tells you how
to do these things properly in an instant.
 >> Stay informed about: WHERE (06/06/1978 06/06/1979) returns false ? 
Back to top
Login to vote
Skybuck Flying

External


Since: Jan 06, 2008
Posts: 16



(Msg. 22) Posted: Sun Jan 06, 2008 2:00 pm
Post subject: Re: WHERE (#06/06/1978# < #06/06/1979#) works in MS Access. Problem solved ;) [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

No need for manuals, others mention it on the internet.

I have never before seen such a weird way of specifieing a date so I tried
out many things to see what would work and what not.

Apperently the other ones don't work and # has to be used for ms access.

However I am switching to mysql so sooner or later I might have to use a
different date string (?)

Bye,
Skybuck.
 >> Stay informed about: WHERE (06/06/1978 06/06/1979) returns false ? 
Back to top
Login to vote
David Kerber

External


Since: May 11, 2006
Posts: 34



(Msg. 23) Posted: Mon Jan 07, 2008 9:28 am
Post subject: Re: WHERE (06/06/1978 < 06/06/1979) returns false ? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

In article ,
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 Wink

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).
 >> Stay informed about: WHERE (06/06/1978 06/06/1979) returns false ? 
Back to top
Login to vote
David Kerber

External


Since: May 11, 2006
Posts: 34



(Msg. 24) Posted: Mon Jan 07, 2008 9:29 am
Post subject: Re: WHERE (#06/06/1978# < #06/06/1979#) works in MS Access. Problem solved ;) [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

In article ,
says...
> Following SQL example works:
>
> (Birthday <> null) AND
> (Birthday > #06/06/1978#) AND
> (Birthday < #06/06/1979#)

The #'s tell me you're working with Access, which is probably the least
standards-compliant database you can find.

--
Remove the ns_ from if replying by e-mail (but keep posts in the
newsgroups if possible).
 >> Stay informed about: WHERE (06/06/1978 06/06/1979) returns false ? 
Back to top
Login to vote
David Kerber

External


Since: May 11, 2006
Posts: 34



(Msg. 25) Posted: Mon Jan 07, 2008 9:33 am
Post subject: Re: WHERE (06/06/1978 < 06/06/1979) returns false ? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

In article ,
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).
 >> Stay informed about: WHERE (06/06/1978 06/06/1979) returns false ? 
Back to top
Login to vote
Geoff

External


Since: Jan 07, 2008
Posts: 2



(Msg. 26) Posted: Mon Jan 07, 2008 4:03 pm
Post subject: Re: WHERE (#06/06/1978# < #06/06/1979#) works in MS Access. Problem [Login to view extended thread Info.]
Archived from groups: alt>php>sql (more info?)

Zathras wrote:
> On Sun, 6 Jan 2008 12:35:16 -0000, "Paul Lautman"
> wrote:
>
>> Have you ever considered reading a manual?
>
> Do a search on Usenet and you'll find that is a question often put to
> the infamous Skybuck. He prefers people to do his work for him and
> then calls it collaboration.
>

tell me about it
at least he's not as bad as the mi5 guy......
ish
 >> Stay informed about: WHERE (06/06/1978 06/06/1979) returns false ? 
Back to top
Login to vote
vbasic55

External


Since: Feb 11, 2008
Posts: 4



(Msg. 27) Posted: Tue Feb 12, 2008 12:00 am
Post subject: Re: WHERE (06/06/1978 < 06/06/1979) returns false ? [Login to view extended thread Info.]
Archived from groups: alt>comp>lang>borland-delphi, others (more info?)

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" wrote in message

> 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.
>
 >> Stay informed about: WHERE (06/06/1978 06/06/1979) returns false ? 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
multiple column sort MySQL - I am using $qryResult = mysql_query("ALTER TABLE MyTable ORDER BY County"); But I would like it sorted by multiple columns such as $qryResult = mysql_query("ALTER TABLE MyTable ORDER BY County"); $qryResult = mysql_query("ALT...

One query and problem LIMIT - Hi all, I have 2 tables: articles and categories articles table: ------------ articleid categoryid name categories table: --------------- categotyid name description I want to get the last entred 5 articles for each category with one quey: like..

multiple select but ......php/mysql/html - hello, Maybe someone can help me out with this one where i am stuck where i solve this in html or other code? html/php and mysql using in a html form: <tr> <td><?php echo"<font face=$b_fontface size=$b_fontsize&...

Create Tabel - Hi I am having some problems using MySQL. I am trying to create a table in a database using the query "CREATE TABLE enquiries (id int(6) NOT NULL auto_increment,name varchar(80) NOT NULL,email varchar(80) NOT NULL,company varchar(80) NOT NULL,tele...

Join same columns from two tables - Hi, I have two tabels. Table a and table b. Both tables habe a column named x. I need a sql statement, wich transfers the colum from a and b in the same colum in the resultset. Example: table a, column x cat dog duck human table b, column x cat duc...
   Database Forums (Home) -> PHP SQL All times are: Pacific Time (US & Canada)
Goto page Previous  1, 2
Page 2 of 2

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]