Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problems with dates

Status
Not open for further replies.

astrodestino

IS-IT--Management
Feb 19, 2005
179
0
0
AR
Hi!
I'm migrating my site form mssql & asp to mysql & php and I'm having a problem with this sql sintax.
What I do is select a value between 2 dates and show the results but I cannot figure how to do it in mysql.
My mssql sintax is:

$sqlstm="SELECT * FROM vidas_pasadas where fecha1<=#".$fecha."# and fecha2>=#".$fecha."#";

How should the mysql sintax look like?

Thank you!!!
 
SELECT * FROM vidas_pasadas where fecha1 between firstdate and seconddate
 
ITnx for the reply but I got two columns in the database, one with lowerdate(fecha1) and one with upperdate(fecha2) what I want to do is to select the recorset where the selected date value is greater than fecha1 and smaller than fecha2.
Tnx
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top