I did something like this not long ago.  I had a table
that had about 10 references in it that needed to be
matched up with each date within the range.  

1)  What I did was populate a temporary table with
each date within the range.  
2)  I selected from both tables, the references and
temporary table displaying the date & reference.

Because there was no joining taking place I would get
a row of data for each reference & date (in the
temporary table).

This procedure was written completely in SQL as a
stored procedure to send a result set to a report. 
The report just simply displayed the result set...

As ugly as it may seem, it ran very quickly... This
was due to the fact that I was only working with a
date range from a Sunday thru Saturday.  The range
could have been modified quite simply to produce a
result for any timeframe because of the temp table of
dates controlled the final result set.

I hope this is clear enough and produces the results
you are looking for.

Kurt
DBA - RHWI


Kurt W. Zimmerman
http://www.zazzle.com/kathymaf




 
____________________________________________________________________________________
Food fight? Enjoy some healthy debate 
in the Yahoo! Answers Food & Drink Q&A.
http://answers.yahoo.com/dir/?link=list&sid=396545367
_______________________________________________
New York PHP Community MySQL SIG
http://lists.nyphp.org/mailman/listinfo/mysql

NYPHPCon 2006 Presentations Online
http://www.nyphpcon.com

Show Your Participation in New York PHP
http://www.nyphp.org/show_participation.php

Reply via email to