Hello...
I have a SELECT question that is driving me crazy here. Here's the deal:
I have a main table named 'grants' that has many columns including 'deadline1', 'deadline2', 'deadline3', and 'deadline4'. All are dates. Every grant entry can have as many as four deadlines per year.
Until now, I have only had to search the grants and display the results ordered by the first deadline, deadline1. Now I am being asked to display the grants in order by date, but displaying each grant in the results once for each of its deadlines. If it has three deadlines, it would pop up once on 2002-01-01 ... 2002-07-01 ... 2002-12-01.
My SELECT statement before was:
SELECT * FROM grants WHERE name LIKE '$query%' ORDER BY $sortVar, deadline1 ASC
How could I change this to make it return each entry in the results one time per entry, regardless if it's returning each unique entry more than once. Or maybe there is a way to search the result array and re-order it to suit my needs? Does this make any sense to you at all? Thanks...
Andrew