Is this an array?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • tina robinson
    New Member
    • Feb 2011
    • 13

    Is this an array?

    I have an access 2007 database ... a report I am running, uses a query that uses a one to many relationship. The one table has the person's name, etc. and the many table, has values such as how many times they had dinner out for example ...

    ... now, in the report, I want to take the second 'occurrence' of the above field ("# of dinners out") and subtract it from the first 'occurrence' of the SAME field???

    I do need to actually show the first occurrence and second occurrence values in the report and then the third field would show the difference between them ... well of course there is a SUM function but no SUBTRACT function ... you cannot use the minus because its the same field ... just 2 occurrences (or 2 records of the same person)

    It would look something like this:

    Name # dinners out
    1st 2nd diff
    Joe 10 12 2

    Help!!

    Thanks, Tina
  • ADezii
    Recognized Expert Expert
    • Apr 2006
    • 8834

    #2
    If I understand correctly, you wojld have to create a new Data Source for the Report based on your Query. Kindly Post the SQL for your Query.

    Comment

    • tina robinson
      New Member
      • Feb 2011
      • 13

      #3
      array

      I don't know SQL or VBA very well ... so this may just confuse me ... is there no way to simply refer to the second occurrence of a field - first occurrence of a field ...

      like:

      [dinners out](2)-[dinners out](1)?

      the sql is monsterous for this ...

      Comment

      • NeoPa
        Recognized Expert Moderator MVP
        • Oct 2006
        • 32661

        #4
        Originally posted by Tina Robinson
        Tina Robinson:
        is there no way to simply refer to the second occurrence of a field - first occurrence of a field
        No Tina. One of the fundamental principles is that the data is not held in any specific order. ==> such a concept is anathema to basic database theory.

        It can often be managed by clever manipulation, but it's not simple or standard. Rather it's senseless.

        Comment

        Working...