Query That Uses Different Columns Based Upon User Input

SoleAris

Registered User.
Local time
Today, 09:06
Joined
Aug 29, 2011
Messages
15
Hi all,

I have a database table in which I'm trying to pull sales data and generate sales reports from. The problem I face is that the sales data is recorded into a table with this structure:

Year | Customer | Sales_Month_1 | Sales_Month_2 | Sales_Month_3


Rather than having a single field "Month" in which I could set criteria or prompt the user to select a month to derive sales data from, I need to write a query that through user input (or through some code within the query) the right field will be selected. An example of this would be generating a report for the 1st month of the year, obviously.

Any help here? I can't find info on this.

Thanks in advance!

-Sole
 

Users who are viewing this thread

Back
Top Bottom