CodeCharge Studio
search Register Login  

Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> Archive -> GotoCode Archive

 Date in SQL

Print topic Send  topic

Author Message
Lorenz
Posted: 09/27/2002, 3:47 AM

Hello!
I have a search form to insert a date in "yyyy/mm/dd" mode (type text).
Then, I have to extract record from database and visualize them when a field named initial_date is <= of inserted date, and final_date is >= of inserted date. I have customized SQL for other reasons, so I have :
"SELECT ...
FROM ...
WHERE ...
AND (initial_date <= '$date' AND final_date >= '$date')"

It doesn't work! It's not possible to compare texts?
I use Mysql and PHP 4.0. Thanks a lot!
Nicole
Posted: 10/01/2002, 4:26 AM

Lorenz,
first of all please make sure that dates in "yyyy/mm/dd" format are accepted by mysql, i.e. test query against mysql db.
While you find the correct date format when you get the correct query results. I suppose the problem is with dare format. In case I'm right please refer to the following article that describes how to convert dates in CC: http://www.gotocode.com/art.asp?art_id=132&


   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.