Share via

SQL Help with Due Dates

Anonymous
2011-10-03T23:00:51+00:00

Hi,

I currently used this code in my query to find out the most recent date for a given employee.

  1. SELECT Q.BookID, Q.BorrowerID FROM TableName As Q WHERE DateOut = (SELECT Max(T.DateOut) FROM TableName As T WHERE T.BookID = Q.BookID)

In this same query I have a field that displays the latest date for each employee plus 1 year (called DueDate). How can I somehow calculate if the dates (field called entrydate) are earlier or later than the duedate field?  The way it is setup, the duedate will always advance to 1 year with the new date entered into the entrydate field.  What makes it hard is that I can just have a field with specified due dates because the next due date for each employee will change to 1 year from the newly entered date.

Thanks

Microsoft 365 and Office | Access | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

7 answers

Sort by: Most helpful
  1. Anonymous
    2011-10-07T18:07:13+00:00

    The newdue date field is set and I don't have to keep adding a year every year.  It has a date serial code to take the day and month from the enterdate field and use the current year +1.  How will I get the calculations to see if what is entered in the enterdate field is early or late based off of the day and month of the previous enterdate entry for each given employee?

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2011-10-07T16:59:29+00:00

    Your 'duedate' are all one year added to a date that is entered so it is not necessary to store them.  Just add one year in a query whenever the data is needed.

    Additionally the process of adding the one year manually each time is subject to data entry errors.

    Was this answer helpful?

    0 comments No comments