If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Month Captions and Labels
I have table that has 3 fields.
Part Number DueDate Order Quantity Using that table, I created a query that takes each due date for each order and determines the month it is due and what the current month is. The query has several columns. The first column has an expression that checks the due month, if the due month is 1 month greater than the current month, it records the order quantity value. If not, it returns a 0. The second column checks to see if the due month is 2 months greater than the current month, if it is true, it grabs the order quantity value, if not it returns a 0. This sequence continues for 18 columns for 18 months. Depending on when this query is run, the current month will change therefore the value for each column will change. Because of that, I can't simply put the name of the month on each column. My question is this: How can I make the caption of each column the month it is for? If I can't do it in a query, can I do it in a form if I pull the data in the datasheet layout? Is this possible? Thanks, Jasper |
#2
|
|||
|
|||
Month Captions and Labels
This is close ---
TRANSFORM Sum(Jasper.[Order Quantity]) AS [SumOfOrder Quantity] SELECT Jasper.[Part Number], Sum(Jasper.[Order Quantity]) AS [Total Of Order Quantity] FROM Jasper GROUP BY Jasper.[Part Number] PIVOT Format([DueDate],"yyyy (mm) mmmm"); -- KARL DEWEY Build a little - Test a little "Jasper Recto" wrote: I have table that has 3 fields. Part Number DueDate Order Quantity Using that table, I created a query that takes each due date for each order and determines the month it is due and what the current month is. The query has several columns. The first column has an expression that checks the due month, if the due month is 1 month greater than the current month, it records the order quantity value. If not, it returns a 0. The second column checks to see if the due month is 2 months greater than the current month, if it is true, it grabs the order quantity value, if not it returns a 0. This sequence continues for 18 columns for 18 months. Depending on when this query is run, the current month will change therefore the value for each column will change. Because of that, I can't simply put the name of the month on each column. My question is this: How can I make the caption of each column the month it is for? If I can't do it in a query, can I do it in a form if I pull the data in the datasheet layout? Is this possible? Thanks, Jasper |
Thread Tools | |
Display Modes | |
|
|