Warning: Use of undefined constant result - assumed 'result' (this will throw an Error in a future version of PHP) in /data01/hpcsolut/public_html/howtofix/dynamic.php on line 36

Warning: Use of undefined constant pagename - assumed 'pagename' (this will throw an Error in a future version of PHP) in /data01/hpcsolut/public_html/howtofix/dynamic.php on line 46

Warning: Use of undefined constant pagename - assumed 'pagename' (this will throw an Error in a future version of PHP) in /data01/hpcsolut/public_html/howtofix/dynamic.php on line 52

Warning: Use of undefined constant id - assumed 'id' (this will throw an Error in a future version of PHP) in /data01/hpcsolut/public_html/howtofix/dynamic.php on line 54

Warning: Use of undefined constant count - assumed 'count' (this will throw an Error in a future version of PHP) in /data01/hpcsolut/public_html/howtofix/dynamic.php on line 58

Warning: Use of undefined constant debug - assumed 'debug' (this will throw an Error in a future version of PHP) in /data01/hpcsolut/public_html/howtofix/sqlfunctions.php on line 184

Warning: mysqli_num_rows() expects parameter 1 to be mysqli_result, bool given in /data01/hpcsolut/public_html/howtofix/dynamic.php on line 449

Warning: Use of undefined constant pw - assumed 'pw' (this will throw an Error in a future version of PHP) in /data01/hpcsolut/public_html/howtofix/dynamic.php on line 515

Warning: Use of undefined constant result - assumed 'result' (this will throw an Error in a future version of PHP) in /data01/hpcsolut/public_html/howtofix/menu.php on line 3

Warning: Use of undefined constant type - assumed 'type' (this will throw an Error in a future version of PHP) in /data01/hpcsolut/public_html/howtofix/search.php on line 3
Access VB Compare Dates
How to fix anything

Search for :



Access VB Compare Dates

To run date comparisons from a Query use date in this format #mm/dd/yyyy#

e.g.
Select * from table where date_Column between #07/01/2010# and #08/01/2010#


To do date comparison within VB use datavalue in the Insert and/or Select statement:-

strSQL = "INSERT INTO table_name1" _
& " SELECT * " _
& " FROM table_name2" _
& " WHERE ([Date_Field] between " _
& " datevalue('" & strStartdate & "')" _
& " AND datevalue('" & strEnddate & "'))"

DoCmd.RunSQL strSQL    IP