Ask a Question related to PHP Development, Design and Development.
-
Safal Solutions #1
How to you compare dates in a query in Mysql
Dear friends,
Plesae help in finding the correct syntax for comparing two dates in a query
in MySql database
Thank you
Subodh Gupta
Safal Solutions Guest
-
Help with query using dates
I am trying to select records based on a date range, this is the query, it doesn't like the format of the ##form.StartDate## and ##form.EndDate: ... -
MySQL Dates
Hello, I have CFM pages with Searching on Dates in MySQL. As you know MySQL Dates are "yyyy-mm-dd" format. However, we want date entering formats... -
Need to compare query results
I have two queries. #1 and #2. I need to compare the results of each query with one another. If query #2 has information (actually just one... -
Web form dates to MySQL
I am building a admin form (PHP/MySQL), so staff can input Job Vacancy descriptions into the Website via a Web form that can be displayed on the... -
Compare dates for conflict
Hi folks - Writing a scheduling app for equipment. I need to be sure that any new request does not conflict with a request already in the DB. ... -
Sven #2
Re: How to you compare dates in a query in Mysql
take a look into mysql-manual > 6.3.1.2 Comparison Operators
ciao SVEN
Bogdan Stancescu wrote:> Depends on what exactly you're after, but for strict comparison
> arithmetic operators work as expected (<, >, =).
>
> Bogdan
>
> Safal Solutions wrote:
>>> Dear friends,
>>
>> Plesae help in finding the correct syntax for comparing two dates in
>> a query in MySql database
>>
>> Thank you
>> Subodh Gupta
Sven Guest
-
Unregistered #3
Re: How to you compare dates in a query in Mysql
Imagine ur table name as Test 1 which contains two columns "createdate" & "updatedate" & Now if you want to get the records which are created between '01/01/2010' and '31/01/2010' and updated between '01/02/2010' and '28/02/2010' Then Your Query Goes in the below way :
select * from Test1
WHERE Createdate between '2010-01-01' and '2010-01-31'
AND Updatedate between '2010-02-01' and '2010-02-28'
The above query retrieves the data in between the given dates and does not include the action on the given dates....
Regards,
Naresh VodnalaUnregistered Guest



Reply With Quote

