Comparing Dates with SQL

Results 1 to 2 of 2

Thread: Comparing Dates with SQL

  1. #1
    Join Date
    Dec 1969

    Default Comparing Dates with SQL

    I am trying to compare two dates in the WHERE part of my SQL statement as shown below.<BR><BR>WHERE (#"&date&"# - orderdate) &#060; 7 ORDER BY orders.orderno<BR><BR>How ever this doesn&#039t seem to work, there is definately a record that should be displayed when this SQL is executed. I am using an Access 2000 database and VBScript.<BR>Any Ideas?

  2. #2
    Eddie Campbell Guest

    Default RE: Comparing Dates with SQL

    You will need to use the Datdiff function to compare the two dates. e.g.<BR><BR>DateDiff("d", date1, date2) &#060; 7 <BR><BR>See the VbScript Reference for more info<BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts