Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums
Old 11-26-2004, 04:10 PM   #1 (permalink)
maria_arif
Registered User
 
Join Date: Nov 2004
Posts: 3
maria_arif is on a distinguished road
looping problem

hello to all experts there..

i got a big problem with looping here.
my problem is like this:


i have make an sql statement to count students in each class like this. i'm using VB6.0:

select class, count(*) from classes where year='1999'
order by class

and the output is like this:

classA = 10
classB = 5
classC = 0

i want to relocate students from classA to class B and C where i take 3 students from classA to

classB and 2 students from classA to classC and it become like this. the relocation is done with

the value i put in the text box:

classA = 5
classB = 8
classC = 2


and after the relocation was done, each student will get their id number based on their class and

number of students for each class where the output is like this:

classA
______

A001
A002
A003
A004
A005


classB
______

B001
B002
B003
B004
B005
B006
B007
B008

classC
______

C001
C002

how to do it? i really don't know. hope you guys could help me here and i really appreciate for

any help given. Thank you
maria_arif is offline   Reply With Quote
Old 11-29-2004, 08:07 AM   #2 (permalink)
rdove
Masked Moderator
 
rdove's Avatar
 
Join Date: May 2002
Location: Indianapolis, IN
Posts: 260
rdove is on a distinguished road
Sorry, we don't do ppl homework here. Try to come up with some code and test different things. If you can show an effort that you attempted to code this, post your code and we shall see what we can do.
__________________
~Ryan

rdove is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
JavaScript Problem dawkim HTML, XML, Javascript, AJAX 2 01-26-2004 07:02 PM
omfg... well, i may need help just understanding this problem... .pakmon. Standard C, C++ 3 01-08-2004 08:44 AM
Help debugging a power problem Belisarius Lounge 0 10-25-2003 04:44 PM
structure problem Goshi Standard C, C++ 5 04-21-2003 12:19 AM
This is a windows/C problem UnderWing Standard C, C++ 6 03-28-2003 06:17 AM


All times are GMT -8. The time now is 08:20 PM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0 RC8





Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting