Dynamic Table Record Columns

Need help here for dynamic column

sample: if my search is monthly ex. January-March my columns should be January | February | March
             and if my search is weekly ex. 3-6 my columns should be Week 3 | Week 4 | Week 5 | Week 6

Thanks in advance.
I highly recommend that you "pivot" your results to make this work (add a column to the results representing the week number, month, etc.). The alternative is to have an output structure for the query that is very generic (has, say, 12 fields like "result1", "result2", etc.) to receive the output, and you use the right columns based on what kind of inputs you used (months, weeks, and so on).

I am also wondering about this, do you have a sample or something similar to it?