Results 1 to 6 of 6
  1. #1
    iProRyan is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Dec 2011
    Location
    England, United Kingdom
    Posts
    44

    Automatically Calculate Days Between & Overdue Query

    Hi Guys,



    I would like to thank everyone for their help recently, but another issue.

    On my Rental form I have a date out and date in date, the date out is the day the dvd will be rent out, and the date in is the date due back, how can I get a text box to automatically calculate the different between the two, so it says number of days: 3 or whatever, badly explained I know, sorry. After this I will need to create a query to show overdue DVDs, how would I go about doing this, so the query needs to be "Show Rentals that date in is less than current date"

    Thanks,

    Ryan

  2. #2
    aytee111 is offline Competent At Times
    Windows 7 32bit Access 2010 32bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    1) Use DateDiff to get the number of days.

    2) Use < Date() to find dates before today

  3. #3
    iProRyan is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Dec 2011
    Location
    England, United Kingdom
    Posts
    44
    Hi,

    Can you show me an example of the DateDiff and "< Date()" commands, and in which criteria box would I put them in my query?

    Thanks,

    Ryan

  4. #4
    alansidman's Avatar
    alansidman is offline VIP
    Windows 7 32bit Access 2007
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,529
    check this out for descriptions and how to use

    http://www.techonthenet.com/access/f...ndex_alpha.php

  5. #5
    iProRyan is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Dec 2011
    Location
    England, United Kingdom
    Posts
    44
    Hi,

    Thanks for that website proves quite helpful however I still cannot do what I require can someone show me an example and where would I enter the code on the query?

  6. #6
    alansidman's Avatar
    alansidman is offline VIP
    Windows 7 32bit Access 2007
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,529
    Ryan;
    Attached is an example that shows overdue without using a query. All information is in the form. Look at the calculations and conditional formatting in design view of the form.

    Alan
    Attached Files Attached Files

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Over 60 Days Query
    By sandy budd in forum Queries
    Replies: 13
    Last Post: 03-08-2012, 09:27 AM
  2. How to Calculate days of the week
    By djclntn in forum Database Design
    Replies: 3
    Last Post: 02-26-2011, 11:10 PM
  3. Replies: 1
    Last Post: 11-12-2010, 01:16 AM
  4. Select Dates between days and two days ago?
    By rstonehouse in forum Queries
    Replies: 4
    Last Post: 08-18-2010, 02:13 AM
  5. calculate no. of working days
    By JOSE LUIS in forum Access
    Replies: 1
    Last Post: 02-01-2010, 03:55 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums