Results 1 to 2 of 2
  1. #1
    JoshZulaica is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Jun 2011
    Location
    Mexico City
    Posts
    1

    Crosstab Query - Column differences conflict

    Hello, and thanks for reading, I'm new here.

    I have a crosstab query with Date (dd/mm/yyyy) as columns, and serial numbers of financial instruments as rows. The total amounts (of holdings) are the Value.




    What I need is to calculate the "daily net change", in order to do this, I have to substract the amount of each date by the amount of the previous date.

    For example:
    -----------03/01/2011-----04/01/2011-----07/01/2011
    LD-110203----12000-----------12000---------14515
    XA-110331-----1587------------1587---------1587
    BI-110602------2112-------------0-------------0


    Should turn out as:

    -----------03/01/2011-----04/01/2011-----07/01/2011
    LD-110203----12000------------0-------------2515
    XA-110331-----1587------------0--------------0
    BI-110602------2112----------2112-----------0


    How can I accomplish this? I've tried a lot of things, and looked around on the internet but I have only found solutions to monthly net changes, since just assigning custom names to the columns like FebDiff: [Feb]-[Jan] is simple for that little number of columns.

    (I'd like to note that the columns do not include all days in a year, only working days. So manually creating custom column headers is not really an option.. And if it helps in any way, I have a separate table in which I write the next date to be added to that list of dates.)

    Thanks in advance for any help.
    Last edited by JoshZulaica; 06-22-2011 at 01:19 PM.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,626
    You can build another query that references this query and calculate the differences within the query or use the crosstab as RecordSource for report and do calcs in textboxes. Problem is these field names will continually change so you would have to rebuild queries/reports. I don't see a solution.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Replies: 1
    Last Post: 04-13-2011, 12:11 PM
  2. Replies: 20
    Last Post: 02-14-2011, 10:55 AM
  3. Replies: 5
    Last Post: 09-10-2010, 10:07 AM
  4. Replies: 1
    Last Post: 09-05-2010, 11:28 AM
  5. Dynamic Column Headers but NOT CROSSTAB
    By jtkjames in forum Queries
    Replies: 1
    Last Post: 07-26-2010, 05:16 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