I am looking at trying to sort information on a sheet.. I have tried sort by.. group by I have remade my page 10 times... I just can't figure it out.
this is what I need results of:
11-23-2011
record 1 Persons name | sold | Trade in | 11-23-2011
record 2 Persons name | sold | Trade in | 11-23-2011
as many records as there may be for this date etc..
11-22-2011
record 1 Persons name | sold | Trade in | 11-22-2011
record 2 Persons name | sold | Trade in | 11-22-2011
record 3 Persons name | sold | Trade in | 11-22-2011
as many records as there may be for this date etc..
etc..
Right now all I can get is this..
11-23-2011
record 1 Persons name | sold | Trade in | 11-23-2011
11-23-2011
record 2 Persons name | sold | Trade in | 11-23-2011
as many records as there may be for this date etc..
11-22-2011
record 1 Persons name | sold | Trade in | 11-22-2011
11-22-2011
record 2 Persons name | sold | Trade in | 11-22-2011
11-22-2011
record 3 Persons name | sold | Trade in | 11-22-2011
as many records as there may be for this date etc..
I hope this makes sense.>>
I am trying to make a list that is sorted by the date. and list those sorted by that day .. and then go to the next day... etc..
You can't do this directly in SQL. You order it by the date, and you need to use your language to split them into something readable. All you need is to set a variable before the loop, and update it with the iteration's record date. When it detects that the date has changed, it then provides a new div or table or whatever you using to split it up visually.
What I do is i do a primary select first to get all the dates with records in the db sort of like a group by date or a select unique
then for each itteration of that loop I call a sp that generates the entries for that date but in your case you could do a sub select of entries by date
__________________
A programmer is just a tool which converts caffeine into code
It simply tracks the known date, and if the date changes it forces a structural change in the HTML so that we can see it differently. The above will actually leave a bad entry in place since it starts at null which your date probably never is, so the first thing it does is open and closes a div before creating a new one. A few ways around that one too, I'd check if the $mLastDate is null and if it is, I wouldn't close and open a new div, but just print the date. Otherwise, close the div open a new one and print the date.