Simple Query - but I'm rusty

exo

Registered User.
Local time
Today, 06:31
Joined
May 21, 2009
Messages
23
My memory is not what it used to be... what a horrible feeling that is!

I have a table that track monthly data for several thousand products.

The idea is to grab the first month and the first three months of sales for each product.

So I simply need to have a statement that scans through a predefined set of fields and seeks the first none zero value. This become the first month of sales (even if it is the 5th month of the year). It then needs to be able to grab the proceeding 2 months to create a sum of sales in the first 3 months. (however that would be for a second field, so presumably that is just a slightly more complex version of the same formula used to find the first month of sales)

As I write this out, I realize I may need to write a module to do this.... however I am interested to know if a query can handle it. Any advice would be appreciated, however advice with leads that can get me on track are even more appreciated =)
 
Sounds like your trying to run a macro on a spreadsheet not develop a query for a database.

If you'd like to post sample data from your table (including actual table name and field names) along with what the final resulting data should be from that starting data, possibly we can help you arrive at the best solution. Use this format for posting data:

TableNameHere
Field1Name, Field2Name, Field3Name, ...
David, 4/5/2006, 136
Sally, 3/8/2009, 45
Tom, 8/9/2008, 59
 

Users who are viewing this thread

Back
Top Bottom