Re: compare dates

2005-02-18 Thread Roger Baklund
Reinhart Viane wrote: Concerning datetime type: Eg. in a forum if someone posts a message the date and the time is stored and shown of that message. I suppose they use timestamp in that case? They could, but because of the 'magic' behaviour of TIMESTAMP a DATETIME is often used. To conserve space,

Re: compare dates

2005-02-18 Thread Gabriel PREDA
Reinhart's request was to keep it's DATE type in place instead of changing it to DATETIME... that's why I emphasized that DATE is better and he should keep it that way ! (Comming back to it if I think... a DATE column beside a TIME column would use 6 bytes... not 8 bytes as DATETIME... at 100 milli

Re: compare dates

2005-02-18 Thread Roger Baklund
Gabriel PREDA wrote: Let me assure you that DATETIME is the worst choice ever... because it need 8 bytes per record... TIMESTAMP uses only 4 ...but TIMESTAMP has a special behaviour which may not be wanted in all cases: the first TIMESTAMP column of a table is updated automatically when _any_ col

RE: compare dates

2005-02-18 Thread Reinhart Viane
] Verzonden: vrijdag 18 februari 2005 12:30 Aan: [EMAIL PROTECTED]; mysql@lists.mysql.com Onderwerp: Re: compare dates Let me assure you that DATETIME is the worst choice ever... because it need 8 bytes per record... TIMESTAMP uses only 4 DATE uses only 3, so does TIME YEAR is the smallest... 1

Re: compare dates

2005-02-18 Thread Gabriel PREDA
Let me assure you that DATETIME is the worst choice ever... because it need 8 bytes per record... TIMESTAMP uses only 4 DATE uses only 3, so does TIME YEAR is the smallest... 1 byte. You can do: SELECT * FROM activities WHERE act_date >= NOW() But for optimization... you should not compute in

RE: Compare dates

2003-11-24 Thread Prakash Kamani
Hi Manisha I have used the same thing in a pretty different way. Basicallyi have stored the date in string format say 'MMDD' and then done simple comparison say 20031125<20031029 by converting it into Long format in my local code (note::this will specially work in case of MMDD forma