Multiple WHERE with dates ...

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
pepe_lepew1962
Forum Commoner
Posts: 44
Joined: Thu Nov 20, 2008 10:29 am

Multiple WHERE with dates ...

Post by pepe_lepew1962 »

Hello:

I am trying to get my mysql query working and it says it is empty, which is impossible because I am picking information that I KNOW is in the table. What I am trying to do is to get 2 date variables from my form and to search my table within those dates. I do not know if it matters, but my table fields also have h:m:s while my date variables don't. I have tried many variances but continue to fail. Can anyone help me please.
//
//
$frmQuery1101 = "SELECT tblTable1.fldField00, tblTable1.fldField19, tblTable1.fldField27, tblTable2.fldField00, tblTable2.fldField01, tblTable2.fldField02, tblTable2.fldField03, tblTable2.fldField04, tblTable2.fldField05 FROM tblTable1, tblTable2 WHERE (tblTable1.fldField00 = tblTable2.fldField00) AND WHERE tblTable2.fldField02 BETWEEN $frmDate01 AND $frmDate02 ORDER BY tblTable1.fldField19,tblTable1.fldField00";
Post Reply