Forum Moderators: open

Message Too Old, No Replies

Mysql - Dates from . to .

Recording spans of time

         

Wonderstuff

6:15 pm on Apr 1, 2007 (gmt 0)

10+ Year Member



Just starting out with Mysql - so making usual newbie mistakes.

I have a site that promotes a series of local events.

For example, a local museum has an exhibition from 22nd April to 3 September i.e. not just a single date but an inclusive span of time.

I'll then use PHP to present 'daily' information by venue on my website.

How should I start with 'from - to?'

Many thanks.

justageek

5:18 pm on Apr 2, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Take a look at the between operator. That will allow you to do something like:

select * from table where your_table_date between your_start_date and your_end_date

JAG

Wonderstuff

10:13 am on Apr 3, 2007 (gmt 0)

10+ Year Member



Thanks Justageek

That's the pointer that I was after.

Cheers - W