bCourtney07 Posted February 12, 2008 Share Posted February 12, 2008 Here is my select statement SELECT Employee_ID, Miles, Activity, Minutes, Date FROM Activity_Log WHERE Employee_ID = '{$_POST["Employee_ID"]}' I'm using a MS Access Database with an adodb dsn-less connection. <?php $conn = new COM ("ADODB.Connection") or die("Cannot start ADO"); $connStr = "Driver={Microsoft Access Driver (*.mdb)}; DBQ=F:\Wellness Program\HR Employee Wellness Program.mdb;"; $conn->open($connStr); //Open the connection to the database ?> I want to narrow it down so it'll select information that is dated 01/02/2008 to 08/15/2008. How can I accomplish this? ??? Link to comment https://forums.phpfreaks.com/topic/90724-php-date-question/ Share on other sites More sharing options...
revraz Posted February 12, 2008 Share Posted February 12, 2008 Change your date to something you can use, then you can do WHERE `date` > 2008/01/02 AND `date` < 2008/08/15 Link to comment https://forums.phpfreaks.com/topic/90724-php-date-question/#findComment-465029 Share on other sites More sharing options...
bCourtney07 Posted February 12, 2008 Author Share Posted February 12, 2008 Warning: (null)(): Invoke() failed: Exception occurred. Source: Microsoft OLE DB Provider for ODBC Drivers Description: [Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression 'Employee_ID = 'bcourtney' WHERE Date > 01/02/2008 AND Date < 08/15/2008'. in F:\InetPub\wwwroot\WellnessProgram\DisplayProgress2.php on line 10 ??? What am I doing wrong? Link to comment https://forums.phpfreaks.com/topic/90724-php-date-question/#findComment-465033 Share on other sites More sharing options...
bCourtney07 Posted February 12, 2008 Author Share Posted February 12, 2008 I must just be completely stupid because i can't figure this out. I would greatly appreciate any help :-\ Link to comment https://forums.phpfreaks.com/topic/90724-php-date-question/#findComment-465233 Share on other sites More sharing options...
revraz Posted February 12, 2008 Share Posted February 12, 2008 For one, you can't compare in that date format. Look how I displayed it and how you are. Second, I don't know what ODBC is expecting as operators. Link to comment https://forums.phpfreaks.com/topic/90724-php-date-question/#findComment-465235 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.