Date Comparison (MS-Access)

Results 1 to 3 of 3

Thread: Date Comparison (MS-Access)

  1. #1
    Join Date
    Dec 1969

    Default Date Comparison (MS-Access)

    Hi,<BR><BR>I am trying to update all records which are overdue on the database.<BR>If the DUEDATE field is &#062; current date, then the JOBOVERDUE field should be update to TRUE.<BR><BR>What is wrong with this code?<BR><BR>if rs.Fields("DUEDATE").Value &#062; date() then <BR> rs.Fields("JOBOVERDUE").Value=true <BR>end if<BR><BR>The DUEDATE field in MS-Access is of Date Type. Date() is supposed to be current date.<BR>Am I supposed to do a conversion somewhere?

  2. #2
    Join Date
    Dec 1969

    Default RE: Date Comparison (MS-Access)

    if rs.Fields("DUEDATE").Value &#062; now()<BR><BR>hth<BR><BR>bastien<BR><BR>

  3. #3
    Join Date
    Dec 1969

    Default UPDATE statement.

    Don&#039;t do this by hand, with a loop.<BR><BR>Let the database do it.<BR><BR>UPDATE TheTable<BR>SET JobOverDue = True<BR>WHERE DueDate &#062; Date()<BR><BR>But, that logic really doesn&#039;t make sense. If the Due Date is July 4, 2002 and today is June 14, 2002 - you would flag that as being JOBOVERDUE, when in fact, it isn&#039;t over due until the Date &#060; the DueDate.

Posting Permissions

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