Ok, this is my last resource.
I have some data coming from a view. The view isn't normalized and I can't normalize it. So, I have to deal with what I have.
Currently the view I'm looking at has 3 records
[b]fee_pk[/b] [b]person_id [/b] [b]event_pk[/b] [b]session_pk[/b] [b]session_name[/b] [b]session_date[/b] [b]credit_name[/b] [b]credit_hours[/b]
1 joe1255 23435 64718 session 1 03/19/2008 AAFP Elective 1
2 joe1255 23435 64719 session 2 04/01/2008 AAFP Prescribed 2
3 joe1255 23435 64719 session 2 04/01/2008 AANA 3
As you can see, I have 2 session_pk that are the same (64719).
So, this data should display like this:
[b]Session Name:[/b] session 1
[b]Session Date[/b] Mar 19, 2008
[b]Credit Name[/b] AAFP Elective
[b]Credit Hours[/b] 1
-------------------------------------
[b]Session Name:[/b] session 2
[b]Session Date[/b] April 04, 2008
[b]Credit Name[/b] [b]Credit Hours[/b]
AAFP Prescribed 2
AANA 3
------------------------------------
Meaning: If the session_pk is the same, don't display on a different row, but under the same session name.
I've tried all I know to solve this and can't get it to work.
My approach was to compare the current session_pk with the next session_pk. If they're the same, don't place them on another row, which works, but because I need until the end of my record set, the data shows up repeated on the different row. Like this:
[b]Session Name:[/b] session 1
[b]Session Date [/b] Mar 19, 2008
[b]Credit Name[/b] AAFP Elective
[b]Credit Hours[/b] 1
-------------------------------------
[b]Session Name:[/b] session 2
[b]Session Date[/b] April 04, 2008
[b]Credit Name[/b] [b]Credit Hours[/b]
AAFP Prescribed 2
AANA 3
------------------------------------
[b]Session Name:[/b] session 3
[b]Session Date[/b] April 04, 2008
[b]Credit Name[/b] AANA
[b]Credit Hours[/b] 3
Any help is greatly appreciated. 🙂