Barbara,
> ... I don't know if I'm being asked to add or subtract days...
Why would you want to know that? ADDDATE() doesn't care:
SET @x = -1;
SELECT ADDDATE('1975-1-1', INTERVAL @x DAY);
+--+
| ADDDATE('1975-1-1', INTERVAL @x DAY) |
+
[EMAIL PROTECTED] wrote:
You are right. There are a lot of date functions in MySQL. However, I am
not sure exactly what your needs are...
I think you are trying to compute date intervals (did you NOT see the
INTERVAL keyword when you RTFM?). Most of the date functions currently
supported a
Barbara Deaton wrote:
> All,
>
> I know MySQL comes with all sorts of wonderful functions to do date
> arithmetic, the problem is the context that my application is being
> called in I don't know if a user wants me to add or subtract days. I'm
> just given the number of days that need to be eithe
Unfortunately no, because I don't know if I'm being asked to add or subtract
days. I'm just given a value, and have to transform that into something that
can be added or subtracted.
So for example, all I get with is value 1 meaning 1 day and I need to do
something with a date, for db2 through
"Barbara Deaton" <[EMAIL PROTECTED]> wrote on 08/23/2005 03:36:52 PM:
> All,
>
> I know MySQL comes with all sorts of wonderful functions to do date
> arithmetic, the problem is the context that my application is being
> called in I don't know if a user wants me to add or subtract days.
> I'm
Do You know about INTERVAL?
Use it in an exprecssion or funtion as
..INTERVAL expr type
where expr is any numerical value
* The INTERVAL keyword and the type specifier are not case
sensitive.
The following table shows how the type a