473,382 Members | 1,404 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Setting OrderBy For Chart

I have the following string for a RowSource for a chart which works fine,
except for the Sort Order for the legend. The legend appears in the Order of
Category (Alpha), but I want it in order of a field from the query
qsSumSalesCat called 'SortOrder' (Numeric).

TRANSFORM SUM(qsSumSalesCat.[SalesRate]) AS [SalesRate] SELECT sDate FROM
qsSumSalesCat WHERE PropNum = 1 AND sDate BETWEEN #07 31 2005# AND #07 31
2006# AND Category <'Z' GROUP BY sDate PIVOT Category;

I've tried inserting SortOrder as shown below, but get an error 'Syntax
Error in Transform statement'.

TRANSFORM SUM(qsSumSalesCat.[SalesRate]) AS [SalesRate] SELECT sDate,
SortOrder FROM qsSumSalesCat WHERE PropNum = 1 AND sDate BETWEEN #07 31
2005# AND #07 31 2006# AND Category <'Z' ORDER BY SortOrder GROUP BY
sDate PIVOT Category;

Any help appreciated.
--
Bob Darlington
Brisbane
Aug 25 '06 #1
1 1495
Found the answer. Use the ColumnHeadings property in the PIVOT bit.

--
Bob Darlington
Brisbane
"Bob Darlington" <bo*@dpcmanAX.com.auwrote in message
news:44***********************@news.optusnet.com.a u...
>I have the following string for a RowSource for a chart which works fine,
except for the Sort Order for the legend. The legend appears in the Order
of Category (Alpha), but I want it in order of a field from the query
qsSumSalesCat called 'SortOrder' (Numeric).

TRANSFORM SUM(qsSumSalesCat.[SalesRate]) AS [SalesRate] SELECT sDate FROM
qsSumSalesCat WHERE PropNum = 1 AND sDate BETWEEN #07 31 2005# AND #07 31
2006# AND Category <'Z' GROUP BY sDate PIVOT Category;

I've tried inserting SortOrder as shown below, but get an error 'Syntax
Error in Transform statement'.

TRANSFORM SUM(qsSumSalesCat.[SalesRate]) AS [SalesRate] SELECT sDate,
SortOrder FROM qsSumSalesCat WHERE PropNum = 1 AND sDate BETWEEN #07 31
2005# AND #07 31 2006# AND Category <'Z' ORDER BY SortOrder GROUP BY
sDate PIVOT Category;

Any help appreciated.
--
Bob Darlington
Brisbane

Aug 25 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: P. Emigh | last post by:
By default in more recent versions, Access forms keep users' last sort request in the "orderby" property. That can slow things down considerably, especially when the last user has chosen a...
2
by: DFS | last post by:
Access97: I opened a report, then opened a small form that floats above it and lets you choose report fields to sort on (by issuing the OrderBy statement). Well, apparently OrderBy actually...
2
by: Dutchy | last post by:
Hi there, After spending several hours trying all I could imagine and search for in Google I gave up. In a continuous form I want to sort the choosen column by clicking the header (label) of...
1
by: fecket | last post by:
The following code is used in my db to change the sort order of the report to various fields. I want to take this one stage further and use maybe a Case Select to give 2 or 3 different options to...
2
by: Anil | last post by:
Hello, I am using VS2005 Beta2 and I have added a Simple Line-Graph chart to a ReportViewer control. I can click on the chart and alter for example the Minimum and Maximum scale values of the...
2
by: tim otero | last post by:
I should be able to figure this one out, but it's late: I'm trying to sort a report by two fields. I can do it easily if I hard-code the fields. However, I want to get user input and store the...
7
by: pbd22 | last post by:
Hi. I really need some advice on fine-tuning a stored procedure that is the meat of the search logic on my site. Customers are allowed to save searches, which dumps the search logic in a table...
7
by: qwedster | last post by:
Guys! How to use OrderBy with TimeZoneInfo.GetSystemTimeZones() in C# 3.5 (vide Code snippet 1)? However, I got it in VB.NET 9 (vide Code snippet 2)! Code snippet 1: using System;
4
by: Marc Gravell | last post by:
Ah right - I just saw your explanation of "Source"; yes - I'd have 2 queries, then: switch(Source) { case "File": viewData.blah = (from t in database.Tags where t.FileCount != 0 orderby...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.