Yes, the problem is the version that you are using. The date_add and
date_sub functions are new in mysql 3.22. How painful would it be for you
to upgrade to the current version?
Given the amount of development since version 3.21, it might be advisable to
go to 3.23.
Regards,
Gary "SuperID" Huntress
=======================================================
FreeSQL.org offering free database hosting to developers
Visit http://superid.dyndns.org:8080/freesql/index.php
----- Original Message -----
From: "Stefen Lars" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Saturday, March 31, 2001 2:25 PM
Subject: Re: Selecting 3 days worth of data with an offset of 5 days from
now()
> Hello Gary
>
> Thank you for your timely response, however MySQL server version 3.21.33b
> responded:
>
> ERROR 1064: parse error near '(now(), interval 5 day) and
> date_sub(now(), interval 2 day)
> order by datestamp d' at line 2
>
> :-((
>
> when I entered exactly what you suggested. What am I doing wrong?
>
> S.
>
>
> >From: "Gary Huntress" <[EMAIL PROTECTED]>
> >To: "Stefen Lars" <[EMAIL PROTECTED]>, <[EMAIL PROTECTED]>
> >Subject: Re: Selecting 3 days worth of data with an offset of 5 days from
> >now()
> >Date: Sat, 31 Mar 2001 09:04:48 -0500
> >
> >Try this:
> >
> >select * from visitor where
> > datestamp between
> > date_sub(now(), interval 5 day) and
> > date_sub(now(), interval 2 day)
> > order by datestamp desc;
> >
> >Regards,
> >
> >Gary "SuperID" Huntress
> >
> >=======================================================
> >FreeSQL.org offering free database hosting to developers
> >Visit http://superid.dyndns.org:8080/freesql/index.php
> >
> >----- Original Message -----
> >From: "Stefen Lars" <[EMAIL PROTECTED]>
> >To: <[EMAIL PROTECTED]>
> >Sent: Saturday, March 31, 2001 1:31 PM
> >Subject: Selecting 3 days worth of data with an offset of 5 days from
now()
> >
> >
> > > Hello all
> > >
> > > I am looking for a way to return 3 days worth of data with an offset
of
> >five
> > > days (in the past) from today.
> > >
> > > For example, say we had the following dates and today is 2001-03-31.
> >First
> > > we do:
> > >
> > > select name, datestamp from visitor_data order by datestamp desc;
> > >
> > > and are returned with this list
> > >
> > > name datestamp
> > >
> > > jon 2001-03-31
> > > peter 2001-03-29
> > > sam 2001-03-26
> > > joe 2001-03-25
> > > pete 2001-03-25
> > > zed 2001-03-25
> > > chris 2001-03-24
> > > paul 2001-03-22
> > > simon 2001-03-22
> > >
> > > Now, I am looking for a way to return just the following data:
> > >
> > > sam 2001-03-26
> > > joe 2001-03-25
> > > pete 2001-03-25
> > > zed 2001-03-25
> > > chris 2001-03-24
> > >
> > > How can this be done?
> > >
> > > I would be really very grateful if someone could point me in the right
> > > direction or offer a link to a resource with some example of what I
> >would
> > > like to do. I already looked in the manual and the example:
> > >
> > > SELECT something FROM table WHERE TO_DAYS(NOW()) - TO_DAYS(date_field)
> ><=
> > > 30;
> > >
> > > is interesting, but is not really what I want to do.
> > >
> > > If anyone can help me, I thank you whole-heartedly in advance.
> > >
> > > S.
> > >
> > >
> > >
> > >
> >_________________________________________________________________________
> > > Get Your Private, Free E-mail from MSN Hotmail at
> >http://www.hotmail.com.
> > >
> > >
> > > ---------------------------------------------------------------------
> > > Before posting, please check:
> > > http://www.mysql.com/manual.php (the manual)
> > > http://lists.mysql.com/ (the list archive)
> > >
> > > To request this thread, e-mail <[EMAIL PROTECTED]>
> > > To unsubscribe, e-mail
> ><[EMAIL PROTECTED]>
> > > Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
> > >
> >
>
> _________________________________________________________________________
> Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
>
>
> ---------------------------------------------------------------------
> Before posting, please check:
> http://www.mysql.com/manual.php (the manual)
> http://lists.mysql.com/ (the list archive)
>
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail
<[EMAIL PROTECTED]>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
>
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php