Results 1 to 2 of 2
  1. #1
    jtkjames is offline Novice
    Windows XP Access 2002
    Join Date
    Jul 2010
    Posts
    9

    Dynamic Column Headers but NOT CROSSTAB

    I have a simple query, polling on several crosstab queries with fixed column headers based on relative dates. Basically the infamous Duane Hookom advice for relative dates.

    What I cannot do, however, is turn the relative headers (that I am querying) back into ones that make sense. I have attached the SQL code of the simple query as it is:

    Code:
     
    SELECT qry_sub_GetSoldLast3Months.[End Item], 
    qry_sub_GetSoldLast3Months.[Mth-3], 
    qry_sub_GetSoldLast3Months.[Mth-2], 
    qry_sub_GetSoldLast3Months.[Mth-1], 
    qry_sub_GetSoldLast3Months.[Mth0]
    and how I would "like" it to be

    Code:
     
    SELECT qry_sub_GetSoldLast3Months.[End Item], 
    qry_sub_GetSoldLast3Months.[Mth-3] AS [dateadd("mm-yy", -3, now())], 
    qry_sub_GetSoldLast3Months.[Mth-2] AS [dateadd("mm-yy", -2, now())], 
    qry_sub_GetSoldLast3Months.[Mth-1] AS [dateadd("mm-yy", -1, now())], 
    qry_sub_GetSoldLast3Months.[Mth0] AS [dateadd("mm-yy", 0, now())]
    except of course, this doesn't work, because the aliases are not dynamic i.e. won't return 05-10, 06-10 and 07-10 etc - they will return literally "dateadd(..."



    I know there is lots of info on how to do this with a crosstab, transform statement - but my question to the experts out there is: is it possible with a select query?

    Any advice appreciated - thanks!!

  2. #2
    jtkjames is offline Novice
    Windows XP Access 2002
    Join Date
    Jul 2010
    Posts
    9
    anyone????

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

Similar Threads

  1. Access Report w/o Column Headers
    By stattech in forum Reports
    Replies: 8
    Last Post: 06-10-2010, 02:07 AM
  2. Replies: 1
    Last Post: 04-15-2010, 02:07 AM
  3. Hide Duplicates with Group Headers
    By diwin in forum Reports
    Replies: 0
    Last Post: 03-26-2009, 09:32 AM
  4. help with dynamic hyperlink to pdf
    By iresolver in forum Access
    Replies: 0
    Last Post: 12-24-2008, 01:21 PM
  5. inserting values in column based another column
    By wasim_sono in forum Database Design
    Replies: 1
    Last Post: 06-27-2006, 05:23 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