Results 1 to 12 of 12
  1. #1
    TheSpecialist is offline Advanced Beginner
    Windows 8 Access 2010 64bit
    Join Date
    Jul 2015
    Location
    Georgia
    Posts
    47

    How to make this horizontal

    Hello group I have the column below going vertical in the union query how can I make this horizontal please assist thank you







    SourceTable
    Cash4Table
    Cash4Table
    Cash4Table
    Cash4Table
    Cash4Table
    Cash4Table
    GAFiveTable
    GAFiveTable
    GAFiveTable
    GAFiveTable
    GAFiveTable
    GAFiveTable
    MoonPhaseTable
    MoonPhaseTable
    MoonPhaseTable
    MoonPhaseTable
    MoonPhaseTable
    MoonPhaseTable
    YourTable
    YourTable
    YourTable
    YourTable
    YourTable
    YourTable
    Last edited by TheSpecialist; 05-06-2016 at 08:17 AM. Reason: not clear

  2. #2
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,397
    not sure what you mean from the 'data' provided, but my immediate response would be to use a crosstab query, although this requires a minimum of three columns.

  3. #3
    TheSpecialist is offline Advanced Beginner
    Windows 8 Access 2010 64bit
    Join Date
    Jul 2015
    Location
    Georgia
    Posts
    47
    Thank you Ajax this is exactly what I need

  4. #4
    TheSpecialist is offline Advanced Beginner
    Windows 8 Access 2010 64bit
    Join Date
    Jul 2015
    Location
    Georgia
    Posts
    47
    Question how can I take this script below and make it horizontal without using the crosstab because its bring up information that i do not need in the format

    PARAMETERS [Enter Date:] DateTime, [Enter YourNumber:] IEEEDouble;
    SELECT "YourTable" AS SourceTable, YourDate, YourNumber
    FROM YourTable
    WHERE YourDate BETWEEN [Enter Date:]-1 AND [Enter Date:]+1
    UNION ALL
    SELECT "Cash4Table", YourDate, YourNumber
    FROM Cash4Table
    WHERE YourDate BETWEEN [Enter Date:]-1 AND [Enter Date:]+1
    UNION ALL
    SELECT "GAFiveTable", YourDate, YourNumber
    FROM GAFiveTable
    WHERE YourDate BETWEEN [Enter Date:]-1 AND [Enter Date:]+1
    UNION ALL SELECT "MoonPhaseTable", YourDate, YourNumber
    FROM MoonPhaseTable
    WHERE YourDate BETWEEN [Enter Date:]-4 AND [Enter Date:]+1
    ORDER BY SourceTable, YourDate;

  5. #5
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,397
    don't understand what you are asking - provide some sample data and the outcome you require.

    Also, does not look like your data is normalised - otherwise you wouldn't need the union query

  6. #6
    TheSpecialist is offline Advanced Beginner
    Windows 8 Access 2010 64bit
    Join Date
    Jul 2015
    Location
    Georgia
    Posts
    47

    below I like when I can enter the paraments but I want the data from Source table to be my column headings going acrooss. Like Cash4 Table then GA5table(going horiontal
    then for the YourDate and Your Number I would like to keep that there like it is below but its just attached still to the information that would go with Columns for Cash4Table and etc going horizontal. Thank you
    SourceTable YourDate YourNumber
    Cash4Table 05/14/2015 8 8 0 4
    Cash4Table 05/14/2015 3 7 4 9
    Cash4Table 05/15/2015 3 5 3 1
    Cash4Table 05/15/2015 3 7 4 7
    Cash4Table 05/16/2015 2 0 4 7
    Cash4Table 05/16/2015 3 6 7 3
    GAFiveTable 05/14/2015 3 8 5 2 0
    GAFiveTable 05/14/2015 4 8 8 3 2
    GAFiveTable 05/15/2015 6 0 7 4 6
    GAFiveTable 05/15/2015 7 9 1 8 2
    GAFiveTable 05/16/2015 2 2 4 1 5
    GAFiveTable 05/16/2015 5 7 6 6 8
    MoonPhaseTable 05/11/2015 0.53
    MoonPhaseTable 05/12/2015 0.41
    MoonPhaseTable 05/13/2015 0.3
    MoonPhaseTable 05/14/2015 0.2
    MoonPhaseTable 05/15/2015 0.12
    MoonPhaseTable 05/16/2015 0.05
    YourTable 05/14/2015 7 9 3
    YourTable 05/14/2015 8 7 5
    YourTable 05/15/2015 1 0 3
    YourTable 05/15/2015 1 5 5
    YourTable 05/16/2015 5 1 9
    YourTable 05/16/2015 2 1 3

  7. #7
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,397
    still not quite sure what your output is supposed to look like, but sounds like you need to make sourcetable your column heading and yourdate the row heading

  8. #8
    TheSpecialist is offline Advanced Beginner
    Windows 8 Access 2010 64bit
    Join Date
    Jul 2015
    Location
    Georgia
    Posts
    47
    I want my output to look like this

    Yourdate-------YourNumber------ Cash4Table ------YourTable----GaFiveTable
    5/16/2016 312

  9. #9
    TheSpecialist is offline Advanced Beginner
    Windows 8 Access 2010 64bit
    Join Date
    Jul 2015
    Location
    Georgia
    Posts
    47
    I want my output to look like this when I enter the paramters

    Yourdate-------YourNumber------ Cash4Table ------YourTable----GaFiveTable
    5/16/2016 312

  10. #10
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,397
    as I suggested then

  11. #11
    TheSpecialist is offline Advanced Beginner
    Windows 8 Access 2010 64bit
    Join Date
    Jul 2015
    Location
    Georgia
    Posts
    47
    How would you suggest i do this using the sql. Do think a transform script would work? thank you Ajax

  12. #12
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,397
    try it and see

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

Similar Threads

  1. horizontal scroll bar
    By sdel_nevo in forum Programming
    Replies: 2
    Last Post: 05-28-2015, 08:03 AM
  2. Replies: 1
    Last Post: 03-10-2015, 11:47 AM
  3. Horizontal presentation
    By cacabanga in forum Access
    Replies: 4
    Last Post: 02-11-2012, 07:18 PM
  4. Horizontal Fields
    By labadee in forum Access
    Replies: 1
    Last Post: 06-27-2010, 09:22 PM
  5. Horizontal listbox - ?
    By bane in forum Forms
    Replies: 3
    Last Post: 04-20-2010, 06:48 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