Looks like you are not reseting the value of CurrentDate.  So it loops
through first time until Current Date is not less than or eq to EndDate 
..
then when next employee comes up CurrentDate has not been reset so the
condition is false and the loop never runs.

Try something like this on the line above the loop:

<cfset CurrentDate=GetEmployees.CurrentDate>

::: -----Original Message-----
::: From: Kevin Bridges [mailto:[EMAIL PROTECTED]]
::: Sent: Monday, January 21, 2002 7:59 AM
::: To: CF-Talk
::: Subject: RE: Problems with looping
::: 
::: 
::: Does:
::: 
::: <CFLOOP CONDITION="#CurrentDate# LESS THAN OR EQUAL TO 
#EndDate#">
::: 
::: Evaluate to true for each employee?
::: 
::: ::: -----Original Message-----
::: ::: From: Angel Stewart [mailto:[EMAIL PROTECTED]]
::: ::: Sent: Monday, January 21, 2002 8:02 AM
::: ::: To: CF-Talk
::: ::: Subject: Problems with looping
::: ::: 
::: ::: 
::: ::: Hey all! 
::: ::: 
::: ::: Take a look at this code.
::: ::: 
::: ::: The idea of course, is to loop through all the employees in 
::: ::: the table
::: ::: and run a particular query against each employee.
::: ::: 
::: ::: _______________________________________________________
::: ::: 
::: ::: <CFQUERY name="GetEmployees" datasource="xxxxx" 
::: DBTYPE="ORacle80">
::: ::: 
::: :::         Select Employee_ID FROM Empl_General
::: :::                 
::: ::: </CFQUERY>      
::: ::: 
::: ::: <CFOUTPUT query="GetEmployees">
::: ::: 
::: :::         <CFLOOP CONDITION="#CurrentDate# LESS THAN OR EQUAL TO
::: ::: #EndDate#">::: ::: :::          <CFSET CurrentDat=
::: ::: DateFormat(#CurrentDate#,'mm/dd/yyyy')> 
::: ::: 
::: :::                 <CFQUERY name="GetHours" datasource="xxxx"
::: ::: DBTYPE="Oracle80">
::: :::                         
::: :::                         Select SUM(RegHrs) AS TotalHours FROM
::: ::: TblMainEntry,TblDetailEntry
::: :::                 :::                     WHERE ::: TblMainEntry.EmpI=
::: ::: #GetEmployees.Employee_ID#
::: :::                                 :::                     ::: AND 
:tblDetailEntry.RecordDat=
::: ::: to_date('#currentdate#','mm/dd/yyyy')
::: :::                 
::: :::                         AND tblMainEntry.MainID = 
::: TblDetailEntry.MainID
::: :::                 
::: :::                 </CFQUERY>
::: :::         
::: :::         <CFIF GetHours.TotalHours GT 24>
::: ::: 
::: :::                 #GetHours.Employee_ID# &nbsp&nbsp 
::: #GetHours.TotalHours#
::: :::         
::: :::         </CFIF>
::: :::         
::: :::         <CFSET CurrentDate = DateAdd("d",CurrentDate,1)>
::: ::: 
::: :::         </CFLOOP>
::: :::         
::: ::: </CFOUTPUT>
::: ::: 
::: ::: _______________________________________________-
::: ::: 
::: ::: However, it picks up the first employee, runs through the 
::: ::: SQL statements
::: ::: etc. and then never goes onto the second.
::: ::: 
::: ::: Any idea why this is happening? 
::: ::: 
::: ::: I must be missing something really simple, but I can't 
::: ::: figure out what.
::: ::: 
::: ::: -Angel
::: ::: 
::: ::: 
::: ::: ____________________________________________________________
::: ::: __________
::: ::: Why Share?
::: :::   Dedicated Win 2000 Server � PIII 800 / 256 MB RAM / 40 GB 
::: ::: HD / 20 GB MO/XFER
::: :::   Instant Activation � $99/Month � Free Setup
::: :::   http://www.pennyhost.com/redirect.cfm?adcode=coldfusionc
::: ::: FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
::: ::: Archives: 
http://www.mail-archive.com/[email protected]/
::: ::: Unsubscribe: 
::: http://www.houseoffusion.com/index.cfm?sidebar=lists
::: ____________________________________________________________
::: __________
::: Dedicated Windows 2000 Server
:::   PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER
:::   Instant Activation � $99/Month � Free Setup
:::   http://www.pennyhost.com/redirect.cfm?adcode=coldfusiona
::: FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
::: Archives: http://www.mail-archive.com/[email protected]/
::: Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
______________________________________________________________________
Why Share?
  Dedicated Win 2000 Server � PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER
  Instant Activation � $99/Month � Free Setup
  http://www.pennyhost.com/redirect.cfm?adcode=coldfusionc
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to