By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,258 Members | 1,602 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,258 IT Pros & Developers. It's quick & easy.

Help with SQL Query for Graph

P: n/a
Hello All,

I have a database of various artist's average annual auction prices,
which I would like to graph. In some years there are no sales for an
artist, and therefore no data for that artist for that year, in the

However in selecting the years to graph, I want to commence with the
current year and work back through the data until I reach a year with
no data, so that the graph covers an unbroken period.

For example in the table below, the period to be graphed would be 2000
to 2007, being the unbroken period working back from 2007, as there is
no data for 1999.

1996 $1,300
1998 $1,500
2000 $1,800
2001 $1,900
2002 $1,600
2003 $2,100
2004 $2,400
2005 $2,600
2006 $1,800
2007 $2,200

The length of the period to be graphed will vary from artist to
artist, but all will have a common starting point of the current year,
and work back from there.

Can this be accomplished with a SELECT statement? If not, any ideas as
to how it can be done?

Many thanks in advance,

John Furphy

Feb 22 '08 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.