Veysel,
Monday, October 14, 2002, 12:48:58 PM, you wrote:
VHS> I am using mysql 3.23.52. I have to query one of my tables which has two
VHS> columns with the type of "date" and "time". For example i have to get
VHS> the records whose date are 2002-10-12 and time is bigger than 11:30:00
VHS> and also the records whose date are 2002-10-13 and time is smaller than
VHS> 05:00:00. In other words i have to get a timeline between the
VHS> 2002-10-12/11:30:00 and 2002-10-13/05:00:00.
SELECT * FROM table_name
WHERE CONCAT(date,' ',time)>'2002-10-12 11:30:00'
AND CONCAT(date,' ',time)<'2002-10-13 05:00:00';
SELECT * FROM table_name WHERE (date > "2002-10-12" AND date < "2002-10-13")
AND (time > "11:30:00" AND time < "05:00:00");
--
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.net http://www.ensita.net/
__ ___ ___ ____ __
/ |/ /_ __/ __/ __ \/ / Egor Egorov
/ /|_/ / // /\ \/ /_/ / /__ [EMAIL PROTECTED]
/_/ /_/\_, /___/\___\_\___/ MySQL AB / Ensita.net
<___/ www.mysql.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