List:General Discussion« Previous MessageNext Message »
From:Paul DuBois Date:January 14 2002 4:07am
Subject:Re: DAYOFYEAR()
View as plain text  
At 3:24 +0000 1/14/02, Curtis Gordon wrote:
>Hi! I'm storing a date in this format :
>
>2002-01-13 11:08:40
>yyyy-mm-dd hh:mm:ss
>
>This is great because it gives me the date and the time, which I need.
>I want to compare this date from the database to the current DAYOFYEAR()
>
>but when I do this
>select DAYOFYEAR('2002-01-13 11:08:40')
>
>I get this
>Error - Perl execution failed
>
>Modification of non-creatable array value attempted, subscript -1 at 
>./mysql-lib.pl line 187, line 2.

You're not showing the actual Perl code, only what you suspect is relevant
to the problem at hand.  DAYOFYEAR() works fine with literal dates and with
NOW(), so my guess is that you're constructing your first query improperly
(perhaps a problem with the quote marks).

It's only a guess, because you haven't shown the code.

>
>
>
>It works great when I do select DAYOFYEAR(NOW()) though, I'm totally 
>confused, is this a known bug or is there a work around that anybody 
>knows of that you can let me in on?
>
>Ulitmately I want to compare todays DAYOFYEAR to the DAYOFYEAR from 
>fields in the database to establish entries that were created 
>"today".
>
>I'm looking at what I have written here and I think I have confused 
>myself, if this is not clear, please feel free to flame me.

No flames, just show the code.

>
>I'm looking forward to any light that can be shed on this problem.

Thread
DAYOFYEAR()Curtis Gordon14 Jan
  • Re: DAYOFYEAR()Paul DuBois14 Jan
Re: DAYOFYEAR()Curtis Gordon14 Jan
RE: DAYOFYEAR()Curtis Gordon15 Jan