<!--- DEBUG CODE ---> <CFSET STARTDATE = #CreateODBCDate('9/01/2002')#> <CFSET ENDDATE = #CreateODBCDate('9/30/2002')#> <CFSET client.empid = 1> <!--- DEBUG CODE --->
<td><CFOUTPUT>#startdate#</CFOUTPUT></td> [This CFOUTPUT shows : {d '2002-09-01'} ] </tr> <CFSET TheDate = StartDate><!--- Set variable to the startdate ---><strong></strong> <CFLOOP query="GetClients"> <CFSET TheDate = StartDate> <tr><td><CFOUTPUT>#TheDate#</CFOUTPUT></td></tr> [BUT THIS CFOUTPUT shows: 2002-09-08 00:00:00] <td> <CFOUTPUT>#GetClients.offtime#</CFOUTPUT></td> <cfloop Condition = "#TheDate# LESS THAN OR EQUAL TO #EndDate#"><!--- Create a loop to loop over the days from the startdate to the enddate which should cover an entire month ---> <CFQUERY name="GetHours" datasource="#DSN#"> SELECT * FROM tblMaster,tblDetails WHERE tblMaster.ClientID = '#GetClients.ClientID#' AND tblDetails.RecordDate = #CreateODBCDate(TheDate)# AND tblMaster.empid = #client.empid# AND tblMaster.MasterID = tblDetails.MasterID </CFQUERY> <td class="SnowDataTD"><CFIF #GetHours.RecordHours# GT 0 ><cfoutput>#GETHOURS.RECORDHOURS#</cfoutput> <CFELSE>   </CFIF> </td> <CFSET TheDate = DateAdd("d",TheDate,1)><!--- Increment date value by one ---> </CFLOOP><!--- Date Loop ---> <td class="SnowFieldCaptionTD"><CFOUTPUT>#GetClients.clientid#</CFOUTPUT></t d> <td class="SnowFieldCaptionTD"><CFOUTPUT>#GetClients.hoursworked#</CFOUTPUT> </td> <td class="SnowFieldCaptionTD"><CFOUTPUT>#GetClients.hoursbilled#</CFOUTPUT> </td> <td class="SnowFieldCaptionTD"><CFOUTPUT>#GetClients.jobno#</CFOUTPUT></td> <!--- <td class="SnowFieldCaptionTD"><b>Acct Group</b></td> ---> </tr> <!---<CFSET TheDate = #CreateODBCDate('9/01/2002')#> Set variable to the startdate ---> <strong></strong> </CFLOOP><!--- Clients Query ---> How the HELLS did it jump forward 7 days!!?? I am not changing the date ANYWHERE... And I just don't understand what is happening...I'm tearing my hair out and its already short and Im really starting to mess up my scalp. Any ideas?? Yes yes yes I know I can use an Index loop instead of the conditional..I'll fix all those little things I suppose..but before I do that I need to figure out why my dates are suddenly gaining days!! :-\ ARrrrrRRGGHH! What stupid thing am I doing now? :-( -Gel ______________________________________________________________________ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists