SQL Query Help is project number 487741
posted at Freelancer.com. Click here to post your own project.
Bid Count: 2
Average Bid:
$ 30
08/13/2009 at 20:18 EDT
Project Creator:
Penhall
Employer Rating: ![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
(4 reviews)
|
I am populating a radiobuttonlist control for a conference registration. The client has now asked that a max number criteria be added. (so it is either disabled or delisted from the radiobuttonlist control once a max number for each session is reached). Currently, I am building the control using the query: SELECT '<a href=javascript:Start(''popup.aspx?SessionID=' + CAST(Sessions.ID AS NVARCHAR) + ''')>' + Sessions.SessionTitle + '</a> - <font color=' + Themes.color + '>' + Themes.Title + '</font>' AS SessionName, Sessions.ID, Sessions.Block FROM Sessions INNER JOIN Themes ON Sessions.Theme = Themes.ID INNER JOIN SessionBlocks ON Sessions.Block = SessionBlocks.ID WHERE (Sessions.Block = 2) ORDER BY Sessions.Block, Title,SessionName - the sessionname above is just me making it a hyperling to a popup details page. at this point, the tables as used above are: Sessions Themes SessionBlocks New to the database is now a table called Rooms which has a primary key of RoomNumber and is a foreign key in the Sessions table field called Room. Rooms.Capacity has the max number of registrants allowed. The field to count for each record is in a table called 00_MainRegistration the Sessions.ID is stored in a field such as FridayAM. Basically, it would have to count the number of times that the Sessions.ID is in the FridayAM field and compare it to the Rooms.Capacity figure. Hope that makes sense but can clarify further if needed. |