Access 2003
I have a query that when It run, it sort the output by
the week number. 1-1-06 would be week# 1, 1-8-06 would be week# 2, 1-17-06 would be week # 3, and so forth.
The output however was not in order as shown below.
The query treat the Week# as text and not as numeric,
and therefore Week# 11 appear before Week# 5.
Week# A B D
11 $100 $200 $300
5 $110 $210 $320
6 $200 $210 $220
8 $300 $310 $320
9 $400 $410 $420
/////////////////////////////////////////////
TRANSFORM Sum(Table_Graph_Accounting_Other.Total_Cost) AS SumOfTotal_Cost
SELECT FormatNumber(Format([Invoice_Date],"ww"),0) AS Week#
FROM Table_Graph_Accounting_Other
GROUP BY FormatNumber(Format([Invoice_Date],"ww"),0)
ORDER BY FormatNumber(Format([Invoice_Date],"ww"),0)
PIVOT Table_Graph_Accounting_Other.Expense_Category;
I have a query that when It run, it sort the output by
the week number. 1-1-06 would be week# 1, 1-8-06 would be week# 2, 1-17-06 would be week # 3, and so forth.
The output however was not in order as shown below.
The query treat the Week# as text and not as numeric,
and therefore Week# 11 appear before Week# 5.
Week# A B D
11 $100 $200 $300
5 $110 $210 $320
6 $200 $210 $220
8 $300 $310 $320
9 $400 $410 $420
/////////////////////////////////////////////
TRANSFORM Sum(Table_Graph_Accounting_Other.Total_Cost) AS SumOfTotal_Cost
SELECT FormatNumber(Format([Invoice_Date],"ww"),0) AS Week#
FROM Table_Graph_Accounting_Other
GROUP BY FormatNumber(Format([Invoice_Date],"ww"),0)
ORDER BY FormatNumber(Format([Invoice_Date],"ww"),0)
PIVOT Table_Graph_Accounting_Other.Expense_Category;