Results 1 to 3 of 3
  1. #1
    dr4ke is offline Competent Performer
    Windows 7 32bit Access 2007
    Join Date
    Jun 2012
    Posts
    108

    Multiple FIRST/LAST Queries

    I currently have a database, which is split into 1 table and numerous queries (below)...



    Server1Aggregate1
    Server1Aggregate2
    Server1Aggregate3
    Server1Aggregate4
    etc
    etc
    All the way to Server4Aggregate4

    Currently what I have to do is create 3 queries per Server/Aggregate combination to;

    Query 1: Displays the Server/Aggregate combination data from Table1
    Query 2: Take the FIRST row of data from that specific combination, from Query1, and minus's it from the LAST row of data (giving a difference)
    Query 3: Divides the figures from Query 2 to give a 'Daily Growth' and a 'Time Left' figure.

    At the end I then use a UNION query to clump all of the Server/Aggregate combination data into one query, which I will then put into a Report.

    Is there a way of remodelling the queries I have, and having one to do the First/Last calculations perhaps something like;

    IIF(FIND(Server1Aggregate1 do FIRST/LAST sum) THEN (IIF(FIND(Server1Aggregate2 do FIRST/LAST Sum) so on and so on...

    is this possible?

    I'm ok in Access, but have very very limited knowledge in VBA etc.

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,849
    How about telling us in 2 or 3 lines what the application is about? What are you trying to do?
    Sounds like 1 table is not really representative of what you have, but then that's just a guess.

  3. #3
    dr4ke is offline Competent Performer
    Windows 7 32bit Access 2007
    Join Date
    Jun 2012
    Posts
    108
    It's about finding out how long the specified Server has until the memory runs out. All Queries are needed, as they are used to compare the data from the start date and end date. There has to be a 3rd query as I can't mix aggregate and non-aggregate functions together.

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

Similar Threads

  1. Replies: 1
    Last Post: 01-10-2012, 10:12 PM
  2. Multiple Value Fields and Queries
    By nsteenhaut in forum Queries
    Replies: 3
    Last Post: 10-05-2011, 01:10 PM
  3. SQL Multiple Queries
    By mbake085 in forum Queries
    Replies: 5
    Last Post: 05-13-2011, 01:03 PM
  4. Sums of Multiple Queries
    By flsticks in forum Queries
    Replies: 5
    Last Post: 09-16-2010, 09:32 AM
  5. Multiple database queries
    By G0zzy in forum Access
    Replies: 4
    Last Post: 08-28-2009, 12:06 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