List:General Discussion« Previous MessageNext Message »
From:Martin Ramsch Date:September 1 1999 10:50am
Subject:Re: How to use the correct Date and Time Functions
View as plain text  
On Wed, 1999-09-01 12:12:56 +0200, Juergen Buddy Hoffmann wrote:
> How can I get records that match the entered date during a period? for
> example:
> 
> event-name	beginning	end
> search&destroy	1999-05-27	1999-06-10
> 
> Date entered in the search engine
> 1999-05-30 
> 
> What is the correct select statement to retrieve the data?

SELECT *
FROM yourtable
WHERE '1999-05-30' BETWEEN  beginning AND end;

> The user has the option to just enter the year, or year-month
> combination also.

What do you want to happen then? Select all events of this year?
Only select events that span completely that year? ...

Regards,
  Martin
-- 
Martin Ramsch <m.ramsch@stripped> <URL: http://home.pages.de/~ramsch/ >
PGP KeyID=0xE8EF4F75 FiPr=52 44 5E F3 B0 B1 38 26  E4 EC 80 58 7B 31 3A D7
Thread
How to use the correct Date and Time FunctionsJuergen Buddy Hoffmann1 Sep
  • Re: How to use the correct Date and Time FunctionsMartin Ramsch1 Sep
    • Re: How to use the correct Date and Time FunctionsJuergen Buddy Hoffmann1 Sep
    • Re: How to use the correct Date and Time FunctionsJuergen Buddy Hoffmann1 Sep
      • Re: How to use the correct Date and Time FunctionsMartin Ramsch14 Sep
  • Re: How to use the correct Date and Time FunctionsChristian Mack9 Sep
    • Re: How to use the correct Date and Time FunctionsMartin Ramsch14 Sep