List:General Discussion« Previous MessageNext Message »
From:Daniel Kasak Date:March 28 2004 9:36pm
Subject:Re: to_days() error?
View as plain text  
unruhtech wrote:

>the following works:
>SELECT to_days( curdate() + 0 ) , to_days( curdate() + 3 ) FROM table
>732033 732036
>
>but this does not:
>SELECT to_days( curdate() + 0 ) , to_days( curdate() + 4 ) FROM table
>732033 NULL 
>
>an end of month problem or a curdate() problem or what?
>
>curdate( ) + 0,  curdate( ) + 7  
>20040328 20040335 
>
>no month i know of has 35 days in it.
>
>3.23.58 on red hat 7.3
>
>Steve
>
>p.s. any tips for a query on today and today +7 days?
>
>  
>
You can't simply go:

curdate() + x

like you are trying to, as curdate() returns an integer, and your '+ x' 
adds one to it. Use a date addition function.

Dan

-- 
Daniel Kasak
IT Developer
NUS Consulting Group
Level 5, 77 Pacific Highway
North Sydney, NSW, Australia 2060
T: (+61) 2 9922-7676 / F: (+61) 2 9922 7989
email: dkasak@stripped
website: http://www.nusconsulting.com.au

Thread
to_days() error?unruhtech29 Mar
  • Re: to_days() error?Daniel Kasak29 Mar
  • Re: to_days() error?Paul DuBois29 Mar
    • Limiting the data returned to just what I needScott Haneda29 Mar
      • Re: Limiting the data returned to just what I needUnknown Sender29 Mar
      • Re: Limiting the data returned to just what I needMichael Stassen29 Mar