[PHP] RE: Mysql Date got prob!

2003-03-01 Thread Uttam
try:

select
date_format(date_add(arrivaldate1, INTERVAL nights1 DAY), '%Y-%m-%d') as
dept_date1
from mytable
where
(date_add(arrivaldate1, INTERVAL nights1 DAY) BETWEEN '2003-02-01' AND
'2003-02-10')

regds,
-Original Message-
From: Dhaval Desai [mailto:[EMAIL PROTECTED]
Sent: Friday, February 28, 2003 15:48
To: [EMAIL PROTECTED]
Subject: Mysql Date got prob!


Hello,

As related to my earlier question


select  date_format(date_add(arrivaldate1, INTERVAL nights1 DAY), '%Y-
%m-%d') as dept_date1 from mytable where ('dept_date1' BETWEEN
'2003-02-01' AND '2003-02-10')

The above query is valid but returns 0 because 'dept_date1' is treated
as a
string. I want dept_date1 to be treated as  date so that it can be
compared.


I hope it is possible...


Thank you!

-Dhaval


_
Add photos to your messages with MSN 8. Get 2 months FREE*.
http://join.msn.com/?page=features/featuredemail



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



[PHP] RE: Mysql Date got prob!

2003-03-01 Thread Dhaval Desai
Hi,

Thanx for yor reply. Well It worked for me with the same query when I used 
HAVING instead of where. This is what I got from Mysql Database. However 
the solution that you have showed is reall good as well.

Thanx
-Dhaval





From: Uttam [EMAIL PROTECTED]
To: 'Dhaval Desai' [EMAIL PROTECTED],[EMAIL PROTECTED]
Subject: RE: Mysql Date got prob!
Date: Sat, 1 Mar 2003 13:45:53 +0530
try:

select
date_format(date_add(arrivaldate1, INTERVAL nights1 DAY), '%Y-%m-%d') as
dept_date1
from mytable
where
(date_add(arrivaldate1, INTERVAL nights1 DAY) BETWEEN '2003-02-01' AND
'2003-02-10')
regds,
-Original Message-
From: Dhaval Desai [mailto:[EMAIL PROTECTED]
Sent: Friday, February 28, 2003 15:48
To: [EMAIL PROTECTED]
Subject: Mysql Date got prob!
Hello,

As related to my earlier question

select  date_format(date_add(arrivaldate1, INTERVAL nights1 DAY), '%Y-
%m-%d') as dept_date1 from mytable where ('dept_date1' BETWEEN
'2003-02-01' AND '2003-02-10')
The above query is valid but returns 0 because 'dept_date1' is treated
as a
string. I want dept_date1 to be treated as  date so that it can be
compared.
I hope it is possible...

Thank you!

-Dhaval

_
Add photos to your messages with MSN 8. Get 2 months FREE*.
http://join.msn.com/?page=features/featuredemail


_
Add photos to your e-mail with MSN 8. Get 2 months FREE*. 
http://join.msn.com/?page=features/featuredemail

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