TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Lynn Emery
NA
47
56.3k
SQL 12 Month graph
Feb 18 2013 4:17 AM
Hi,
I have a problem regarding a Dundas Chart Graph and an SQL statement.
I want to create a graph which will show customer sales for the last 12 months.
I have created an aspx page with 3 dropdown lists and a Dundas chart which are connected by and SQL DataSource. The first dropdown list is to selects the customer, the 2nd selects month, and the thrid selects year. These dropdown boxes have been set up to access data from a database view.
At the moment if I select customer 'A', Month 'June' and Year '2012' from the dropdown lists the dundas chart will display sales for customer A up until June 2012 it displays 6 months. However I want it to plot 12 months of sales. Therefore if I select june 2012 it should show data from june 2011 to june 2012.
Essentially I want to display 12 months of data up until the month and year selected from the dropdownlists.
The code I am currently using for SQL Data Source is :
SELECT * FROM [Sales] WHERE (([Month]< = @Month) AND ([Customer] = @Customer) AND ([Year] = @Year)) ORDER BY [Month]
Sorry if there is a simple colution for this problem, but I am very new to SQL and C#.
Thank you for your help.
Reply
Answers (
0
)
How can i increase the efficiency of this dynamic sp
Numbers after decimal place not showing.