Results 1 to 4 of 4
  1. #1
    ibergarden is offline Novice
    Windows 7 Access 2007
    Join Date
    Apr 2010
    Posts
    2

    Data calculation between records

    I need to calculate the difference about two dates between records from the same table.
    I have a table called: “ treatments” with the fields: “id”, ”date”, “animalId”, and “treatment”.
    I need to calculate the difference between “treatments” in days.
    I know “datadiff” function, but I don’t know how to compare one record with the next one (or previous).



    Thanks

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 Access 2007
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Here is an example of one way. http://www.baldyweb.com/PrevValue.htm

  3. #3
    ibergarden is offline Novice
    Windows 7 Access 2007
    Join Date
    Apr 2010
    Posts
    2
    Quote Originally Posted by RuralGuy View Post
    Here is an example of one way. http://www.baldyweb.com/PrevValue.htm

    Great!!!!

    Thanks

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 Access 2007
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    You're welcome. Come back and mark this thread as Solved when you get it to do what you want.

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

Similar Threads

  1. Calculation Help
    By edge5511 in forum Programming
    Replies: 4
    Last Post: 12-18-2015, 11:11 AM
  2. How to add text data from records
    By er_manojbisht in forum Reports
    Replies: 3
    Last Post: 03-01-2010, 08:37 AM
  3. Calculation error
    By wasim_sono in forum Forms
    Replies: 1
    Last Post: 03-26-2009, 02:51 PM
  4. Date Calculation -- HELP!
    By klaauser in forum Forms
    Replies: 0
    Last Post: 12-22-2008, 02:14 PM
  5. Calculation
    By thestclair in forum Reports
    Replies: 1
    Last Post: 04-29-2006, 11:03 AM

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