User Name
Password

Go Back   Planetarion Forums > Non Planetarion Discussions > Programming and Discussion
Register FAQ Members List Calendar Arcade Today's Posts

Reply
Thread Tools Display Modes
Unread 28 Mar 2005, 14:07   #1
jjsand84
Registered User
 
Join Date: Mar 2005
Posts: 2
jjsand84 has a little shameless behaviour in the past
VB Help

I am making a program to schedule students to take a test. There should be no more than 10 students, "Max_Number", allowed to take the test at the one time. The "Available Slots" field should show the number of slots available, minus 1, when a student is scheduled for that "Date_ID".
jjsand84 is offline   Reply With Quote
Unread 28 Mar 2005, 21:02   #2
JetLinus
Friendly geek of GD :-/
 
JetLinus's Avatar
 
Join Date: Nov 2000
Location: On my metal roid
Posts: 923
JetLinus has much to be proud ofJetLinus has much to be proud ofJetLinus has much to be proud ofJetLinus has much to be proud ofJetLinus has much to be proud ofJetLinus has much to be proud ofJetLinus has much to be proud ofJetLinus has much to be proud ofJetLinus has much to be proud ofJetLinus has much to be proud of
Arrow Re: VB Help

Ok then! Fair enough...
__________________
[»] Entropy increases! :-/
JetLinus is offline   Reply With Quote
Unread 29 Mar 2005, 01:29   #3
queball
Ball
 
queball's Avatar
 
Join Date: Oct 2001
Posts: 4,410
queball contributes so much and asks for so littlequeball contributes so much and asks for so littlequeball contributes so much and asks for so littlequeball contributes so much and asks for so littlequeball contributes so much and asks for so littlequeball contributes so much and asks for so littlequeball contributes so much and asks for so littlequeball contributes so much and asks for so littlequeball contributes so much and asks for so littlequeball contributes so much and asks for so littlequeball contributes so much and asks for so little
Re: VB Help

So what would you like help with?
queball is offline   Reply With Quote
Unread 29 Mar 2005, 06:08   #4
jjsand84
Registered User
 
Join Date: Mar 2005
Posts: 2
jjsand84 has a little shameless behaviour in the past
Re: VB Help

I am trying to figure out the code to use so that 1 will be subtracted from the Max_Number when a student is scheduled for that Date_ID and the number should appear in the Available Slots field.
jjsand84 is offline   Reply With Quote
Unread 29 Mar 2005, 06:32   #5
Caesar2
Commander
 
Caesar2's Avatar
 
Join Date: Sep 2001
Location: Netherlands
Posts: 146
Caesar2 is just really niceCaesar2 is just really niceCaesar2 is just really niceCaesar2 is just really nice
Re: VB Help

Use SELECT COUNT(*) in your SQL query?
__________________
Quote:
Originally posted by Cochese
Cathaar are not overpowered.

You were just "bashed", live with it.
Caesar2 is offline   Reply With Quote
Unread 29 Mar 2005, 09:21   #6
JetLinus
Friendly geek of GD :-/
 
JetLinus's Avatar
 
Join Date: Nov 2000
Location: On my metal roid
Posts: 923
JetLinus has much to be proud ofJetLinus has much to be proud ofJetLinus has much to be proud ofJetLinus has much to be proud ofJetLinus has much to be proud ofJetLinus has much to be proud ofJetLinus has much to be proud ofJetLinus has much to be proud ofJetLinus has much to be proud ofJetLinus has much to be proud of
Arrow Re: VB Help

Quote:
Originally Posted by jjsand84
I am trying to figure out the code to use so that 1 will be subtracted from the Max_Number when a student is scheduled for that Date_ID and the number should appear in the Available Slots field.
Code:
lblAvailableSlots.Caption = Max_Number - 1
?


Quote:
Originally Posted by Caesar2
Use SELECT COUNT(*) in your SQL query?
Seems no SQL is being used...
__________________
[»] Entropy increases! :-/
JetLinus is offline   Reply With Quote
Unread 29 Mar 2005, 09:47   #7
Structural Integrity
Rawr rawr
 
Structural Integrity's Avatar
 
Join Date: Dec 2000
Location: Upside down
Posts: 5,300
Structural Integrity needs a job and a girlfriendStructural Integrity needs a job and a girlfriendStructural Integrity needs a job and a girlfriendStructural Integrity needs a job and a girlfriendStructural Integrity needs a job and a girlfriendStructural Integrity needs a job and a girlfriendStructural Integrity needs a job and a girlfriendStructural Integrity needs a job and a girlfriendStructural Integrity needs a job and a girlfriendStructural Integrity needs a job and a girlfriendStructural Integrity needs a job and a girlfriend
Re: VB Help

// select tests where more than 10 students are present
SELECT COUNT(*) AS StudentCount, test_ID, test_Date FROM Student_Test WHERE StudentCount > 10 GROUP BY test_ID, test_Date

// get the nr of open slots for every test... this should work in a JET database (MS Access). I don't know if your DB allows the 10-COUNT(*)
SELECT (10 - COUNT(*)) AS OpenSlots, test_ID, test_Date FROM Student_Test WHERE 1 GROUP BY test_ID, test_Date
__________________
"Yay"
Structural Integrity is offline   Reply With Quote
Reply



Forum Jump


All times are GMT +1. The time now is 00:03.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2002 - 2018