Page 2 of 2 FirstFirst 12
Results 16 to 21 of 21
  1. #16
    Jaap's Avatar
    Jaap is offline Advanced Beginner
    Windows 11 Access 2021
    Join Date
    Apr 2017
    Location
    North Holland
    Posts
    49
    Quote Originally Posted by Welshgasman View Post
    I actually use Excel for mine.
    Thank you for this message!



    Jaap

  2. #17
    xps35's Avatar
    xps35 is online now Competent Performer
    Windows 10 Office 365
    Join Date
    Jun 2022
    Location
    Schiedam, NL
    Posts
    232
    There may be an option to make it a little easier in Access by using the ID. However, it only works if you can absolutely guarantee that consecutive positions have consecutive IDs. In a query you can then more easily link the current record to the previous one and make the calculations. In my example I made the calculation for one field.
    Notice that I changed the name of the date field. Date is a reserved word that should not be used as a field name.
    I still believe that Excel is your friend.
    Code:
    SELECT Stand.DatePosition, Stand.[Electriciy-Position-High], Stand.[Electriciy-Position-High]-StandVorig.[Electriciy-Position-High] AS ConsumptionHigh
    FROM Stand 
    LEFT JOIN Stand AS StandVorig ON Stand.ID = StandVorig.ID+1;
    Groeten,

    Peter

  3. #18
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,940
    Yes. You do not want the autonumber as random.
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  4. #19
    Jaap's Avatar
    Jaap is offline Advanced Beginner
    Windows 11 Access 2021
    Join Date
    Apr 2017
    Location
    North Holland
    Posts
    49
    Quote Originally Posted by Welshgasman View Post
    I actually use Excel for mine.
    Thank you.

  5. #20
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,940
    Quote Originally Posted by Jaap View Post
    Thank you.
    You already said this?
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  6. #21
    Jaap's Avatar
    Jaap is offline Advanced Beginner
    Windows 11 Access 2021
    Join Date
    Apr 2017
    Location
    North Holland
    Posts
    49
    Quote Originally Posted by xps35 View Post
    There may be an option to make it a little easier in Access by using the ID. However, it only works if you can absolutely guarantee that consecutive positions have consecutive IDs. In a query you can then more easily link the current record to the previous one and make the calculations. In my example I made the calculation for one field.
    Notice that I changed the name of the date field. Date is a reserved word that should not be used as a field name.
    I still believe that Excel is your friend.
    Code:
    SELECT Stand.DatePosition, Stand.[Electriciy-Position-High], Stand.[Electriciy-Position-High]-StandVorig.[Electriciy-Position-High] AS ConsumptionHigh
    FROM Stand 
    LEFT JOIN Stand AS StandVorig ON Stand.ID = StandVorig.ID+1;
    Thank you Peter,
    These are busy days now, I'm going to try to get the hang of this quickly.

    Jaap

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 4
    Last Post: 10-13-2021, 01:14 PM
  2. Replies: 4
    Last Post: 01-07-2019, 05:20 PM
  3. Replies: 3
    Last Post: 10-19-2015, 11:05 PM
  4. Replies: 2
    Last Post: 03-03-2015, 08:43 PM
  5. Replies: 3
    Last Post: 10-09-2014, 03:31 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