Results 1 to 4 of 4
  1. #1
    mhoctober is offline Novice
    Windows 98/ME Access 97
    Join Date
    Sep 2010
    Posts
    7

    Cross Tab Column Headings...

    Experts...



    my Access database keeps track of orders for frozen food items.

    I have a crosstab query that groups the sale of items by delivery date - with the ultimate aim of it showing me the stock remaining level of item(s) as the week progresses, via a report or a form. We take orders throughout the week from customers.

    The cross tab creates a date column for each day of the week (based on paremetres input via a form), and in this column shows me the item sales.

    I understand the concept of fixing column headers and have created column headers of Day1, Day2, Day3, Day4, Day5 (one weeks worth of data is sufficient for my purposes just now).

    Knowing that I have total item sales data grouped by DeliveryDate could anyone help me with an expression that will consistently produce output column headings of ...

    Day1, Day2, Day3, Day4, Day5

    for ANY set of 5 consecutive dates that are passed to the query and it finds data for?

    I have been playing around with


    ColHead : "Day" & DateDiff("d",Format([orderDeliveryDate],"0"),Date())

    and I think I'm getting close????

    Many thanks...

    Mike

  2. #2
    weekend00 is offline I may not be right
    Windows XP Access 2003
    Join Date
    Aug 2010
    Posts
    1,295
    It looks like you got it already? I just don't think you need to format the orderdeliverydate. this is enough:"Day" & DateDiff("d",orderDeliveryDate,Date())

    what is you question?

  3. #3
    mhoctober is offline Novice
    Windows 98/ME Access 97
    Join Date
    Sep 2010
    Posts
    7
    Weekend00....thanks for the reply. Either the issue runs a little deeper than I have explained or else I maybe missing something very obvious!!!

    If I run the query on 11/9 with the expression

    "Day" & DateDiff("d",orderDeliveryDate,Date())

    where the date parametres from the form are Wed 8/9 and Fri 10/9 I get Day1, Day2 and Day3 as output column headers - albeit the data in these columns is invalid in that Day 1 = Friday and Day 3 = Wednesday.

    If I then run the query again on the same day with the input parametres of 15/9 and 17/9 I get the following column headers...

    Day-4, Day-5 and Day-6.

    What I am trying to achieve is a situation whereby no matter what date I run the query or what dates are passed to it as parametres I always get Day1, Day2, Day3 etc as output column headers with data in the Day1 column that relates to the first date passed to the query, data in the Day2 column that relates to the next date etc....

    Thanks again for the reply.

    Regards

    Mike

  4. #4
    weekend00 is offline I may not be right
    Windows XP Access 2003
    Join Date
    Aug 2010
    Posts
    1,295
    You'd better post you query here, or a simplified database if possible.
    that will be much easier for us to see what happened

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

Similar Threads

  1. Sorting and Populating Report Headings
    By bpowers2010 in forum Reports
    Replies: 1
    Last Post: 08-11-2010, 05:05 PM
  2. Replies: 1
    Last Post: 07-30-2010, 10:28 AM
  3. Page Headings
    By maintt in forum Reports
    Replies: 2
    Last Post: 07-22-2010, 05:18 AM
  4. Replies: 1
    Last Post: 04-15-2010, 02:07 AM
  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