I'm using SQL 2000. I used the odbc dates so I could use the loop with an increment of 1 to click through the day's. If I use the string data for the date it works fine but I don't know how to use a loop and increment on day to a string. It's something in the odbc date conversion that's mucking it up somehow but I don't see why that should be the case.
-----Original Message----- From: Tony Weeg [mailto:[EMAIL PROTECTED] Sent: Thursday, July 24, 2003 11:10 AM To: CF-Talk Subject: RE: simple concept, not working silly question (maybe) but why do you use the createODBCDate function, what db are you using? if you are using mssql server then you can just use dates as dates.... tony weeg uncertified advanced cold fusion developer tony at navtrak dot net www.navtrak.net office 410.548.2337 fax 410.860.2337 -----Original Message----- From: Chris [mailto:[EMAIL PROTECTED] Sent: Thursday, July 24, 2003 12:07 PM To: CF-Talk Subject: simple concept, not working I'm looping over a span of dates and counting how many rental pieces are out on each day. Here's what my code looks like. <Cfset startdate = createODBCDate('8/1/2003')> <cfset enddate = createODBCDate('8/15/2003')> <cfloop index="d" from="#startdate#" to="#enddate#" step="1"> <cfquery name="countReserved" datasource="#datasource#"> Select Count (radios) as daycount from reservedTable where (StartDate <= #d#) AND (ReturnDate >= #d#) AND (radio_id = #form.inv_id#) </cfquery> </cfloop> I hardcoded the dates here for ease of explanation. The problem is when I run this code it returns the numbers for a datespan of 8/3/2003 - 8/17/2003. It's seems to be adding on two days. If I display the output by placing this code within the loop <cfoutput> <tr> <td>#d#</td> <td>#DateFormat(d, "mm/dd/yyyy")#</td> <td>#getreserved.daycount#</td> </tr> </cfoutput> the formatted dates show the correct range but the counts are off by two days. It will show a date of 08/01/2003 and give me the count total for 08/03/2003. What am I missing here? ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Signup for the Fusion Authority news alert and keep up with the latest news in ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

