Hey list
I need a query like this:
Select * from activities where act_date = today or any day
in the future
I have made it work like this:
Sselect * from activities where UNIX_TIMESTAMP()
UNIX_TIMESTAMP(act_date)
Problem is with this thing I have to manually add 23:59:59
to each
Subject: compare dates
Hey list
I need a query like this:
Select * from activities where act_date = today or any day in the future
I have made it work like this:
Sselect * from activities where UNIX_TIMESTAMP() UNIX_TIMESTAMP(act_date)
Problem is with this thing I have
]
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
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_
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
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
I have a table with start_date (date), end_date (date), rate(float) as 3 fields, I
want to compare today's date with start and end date if it is inside this range then
pick up the corresponding rate.
But how mysql stores dates ? (-MM-DD ?) how can i compare with today's date ? I
tried
To: [EMAIL PROTECTED]
Subject: Compare dates
I have a table with start_date (date), end_date (date), rate(float) as 3
fields, I want to compare today's date with start and end date if it is
inside this range then pick up the corresponding rate.
But how mysql stores dates ? (-MM-DD ?) how can i