Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 SQL Query Help!

Author  Topic 

padsp
Starting Member

21 Posts

Posted - 2007-04-04 : 13:31:34
Hi

My client requires a strange solution. I use SQL Server 2000 in VB.NET. I need to populate this result set in Crystal Report grid format. Desired output similar to attendance sheet.
Here are my table structures:

Table: HostDetails
HostID HostName
500 ABC Hotel
501 Xircom
502 Xerox
503 Dell

Table: MeetingDetails
MtgID HostID MtgDate MtgType
100 500 04/10/07 9:30 Tech
101 500 04/10/07 16:00 Analy
102 500 04/10/07 18:00 Survey

Table: Invitees
MtgID InvitID Mandatory Expected(atleast)
100 500 Yes 2
100 501 Yes 1
100 502 No 0
101 500 Yes 10
101 502 Yes 1
101 503 Yes 10
102 500 Yes 1
102 501 Yes 1

Looking for the following resultset for report: here {below time} means I need to leave blank space if Mandatory=Yes so client would print manually how many attended; otherwise print 'X'
Also as you can see each participant is categorized by time/time/mandatory/expected

ID Name 9:30AM Tech M Exp 4PM Analy M Exp 8PM Survey M Exp

500 ABC Hotel {space } Y 2 {space} Y 10 {space } Y 1
501 Xircom {space } Y 1 {print X} No 0 {space } Y 1
502 Xerox {Print X } N 0 {space} Y 1 {Print X} No 0
503 Dell {Print X } N 0 {space} Y 10 {Print X} No 0


Please throw you suggestion in how to get this output. I'm trying to do in procedure.

Thanks again
Bob
   

- Advertisement -