ColdFusion Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Verisign Code Signing
Go Back   Dev Shed ForumsProgramming Languages - MoreColdFusion Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
  #1  
Old November 1st, 2004, 05:44 PM
jdang jdang is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Location: OC, CA
Posts: 49 jdang User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 9 h 15 m
Reputation Power: 4
looping over query 2 consecutive diff date?

Hello everyone,

I'm very new to CF and I have to do some CF programming for work and I'm not quite sure how to do this one problem.

I have 2 tables,
+ tblExams {ExamID, ClassID, ExamName, Date, FullScore, ExtraCredit, Week }
+ tblClassExams { ClassExamID, StudentID, ExamID, Score, Grade }

I'm trying to query out all the students that have 2 consecutive exam grades but from different dates that are under 70, so if a student gets 2 scores under 70 on the same date, it would only count once. If they have 60, 71 on consecutive dates then they're ok. So far I've gotten the query to be:

SELECT * FROM tblClassExams INNER JOIN tblExams ON tblExams.examid = tblClassExams.examid WHERE grade < 70 and [DATE] > #10/1/04# ORDER BY StudentID ASC

I'm not sure how I could loop over the result and extract out the information I needed, I've tried searching this forum but no luck so far. Any tips is greatly appreciated. Thanks..

We're running on CF 5 with Access.
Johnny

Reply With Quote
  #2  
Old November 1st, 2004, 06:24 PM
kiteless kiteless is online now
Moderator
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,512 kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 3 Days 21 h 12 m 37 sec
Reputation Power: 45
Well I don't see how that query is going to give you back 2 consecutive scores under 70 per student. It looks like the query is just bringing back all records for studies that ever got less than a 70 after a certain date.

If that's what you want, you could then use cfquery to loop over the result set, grouping on studentID, and try to determine if for any studentID there are consecutive records.

I still don't see how you're going to know if the failures are "consecutive" though...the query is just pulling out all the records below 70. How would you know that the student didn't fail one test, then pass one (that isn't in the result set because you're specifying less than 70), and then fail another one later?

To be honest, I think you might be biting off more than you can chew with this type of challenge if you are really new to CF. It would be better to get a handle on the basics first and build up to something like this.
__________________
Ask if you have a question, but also help answer questions that you have knowledge of! Thanks, Brian.
How to Post a Question in the Forums

Reply With Quote
  #3  
Old November 2nd, 2004, 01:53 PM
jdang jdang is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Location: OC, CA
Posts: 49 jdang User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 9 h 15 m
Reputation Power: 4
Hi Kiteless

I didn't say that this query will do that that's just how far i've gotten, I dont know how to loop over it and retrieve out the correct result. CF isn't my choice, I've just started this job and the current registrar system is running on CF from the previous IT guy that was there. So now I'm inheriting all the overdue projects, requested features and he's only got a chance to show me some of the basic cf tags and left. Sad huh? hehe

Johnny

Reply With Quote
  #4  
Old November 2nd, 2004, 02:47 PM
kiteless kiteless is online now
Moderator
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,512 kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 3 Days 21 h 12 m 37 sec
Reputation Power: 45
If CF isn't your choice, how would you do this with another language (whichever one is your choice)?

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreColdFusion Development > looping over query 2 consecutive diff date?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five "checkpoints" for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway