Re: Date Problem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Date values can be queried like numeric values

select * from table_name 
where 
'2003-04-21' between Booking_Start_Date and Booking_End_Date;

or you can write the statement like that :

select * from table_name 
where 
'2003-04-21' >= Booking_Start_Date and  '2003-04-21' <=Booking_End_Date;

HTH

Mustafa OCAK
PHP Developer
Ankara, Turkey




----- Original Message ----- 
From: "shaun" <shaun@mania.plus.com>
To: <php-db@lists.php.net>
Sent: Monday, April 21, 2003 3:47 PM
Subject: Re:  Date Problem


> "Jason Wong" <php-db@gremlins.biz> wrote in message
> 200304211711.46147.php-db@gremlins.biz">news:200304211711.46147.php-db@gremlins.biz...
> > On Monday 21 April 2003 17:06, shaun wrote:
> >
> > > I have two columns in my table in date format: Booking_Start_Date and
> > > Booking_End_Date.
> > >
> > > Is it possible to query the database to find out if a given date is
> between
> > > either of these dates?
> >
> > Yes, archives > between date
> >
> > --
> > Jason Wong -> Gremlins Associates -> www.gremlins.biz
> > Open Source Software Systems Integrators
> > * Web Design & Hosting * Internet & Intranet Applications Development *
> > ------------------------------------------
> > Search the list archives before you post
> > http://marc.theaimsgroup.com/?l=php-db
> > ------------------------------------------
> > /*
> > All the simple programs have been written.
> > */
> >
> 
> Thanks for your reply but i cant find any reference to this particular
> problem in the archives...
> 
> 
> 
> -- 
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux