interesting. wonder if you have you could send along a dump of form. i ran this code and got correct results:
<cfset WSdepDAY="9"> <cfset WSdepMONTH="3"> <cfset WSdepYEAR="2010"> <cfset WSretDAY="20"> <cfset WSretMONTH="3"> <cfset WSretYEAR="2010"> March 9 to March 20 comes out incorrectly as 11 days<br> March 10 to March 20 comes out incorrectly as 10 days<br> March 10 to March 30 comes out *correctly* as as 21 days<Br> combine the numbers and create a date:<Br> <cfset req.departdate = #createDATE(WSdepYEAR,WSdepMONTH,WSdepDAY)# /> <cfset req.returndate = #createDATE(WSretYEAR,WSretMONTH,WSretDAY)# /> <cfset req.daysAway = #DateDiff("D",req.departdate,req.returndate)#+1 > <cfoutput><cfdump var="#req#"></cfoutput> <cfset WSdepDAY="10"> <cfset WSdepMONTH="3"> <cfset WSdepYEAR="2010"> <cfset WSretDAY="20"> <cfset WSretMONTH="3"> <cfset WSretYEAR="2010"> <cfset req.departdate = #createDATE(WSdepYEAR,WSdepMONTH,WSdepDAY)# /> <cfset req.returndate = #createDATE(WSretYEAR,WSretMONTH,WSretDAY)# /> <cfset req.daysAway = #DateDiff("D",req.departdate,req.returndate)#+1 > <cfoutput><cfdump var="#req#"></cfoutput> <cfset WSdepDAY="10"> <cfset WSdepMONTH="3"> <cfset WSdepYEAR="2010"> <cfset WSretDAY="30"> <cfset WSretMONTH="3"> <cfset WSretYEAR="2010"> <cfset req.departdate = #createDATE(WSdepYEAR,WSdepMONTH,WSdepDAY)# /> <cfset req.returndate = #createDATE(WSretYEAR,WSretMONTH,WSretDAY)# /> <cfset req.daysAway = #DateDiff("D",req.departdate,req.returndate)#+1 > <cfoutput><cfdump var="#req#"></cfoutput> RESULTS: struct DAYSAWAY 12 DEPARTDATE {ts '2010-03-09 00:00:00'} RETURNDATE {ts '2010-03-20 00:00:00'} struct DAYSAWAY 11 DEPARTDATE {ts '2010-03-10 00:00:00'} RETURNDATE {ts '2010-03-20 00:00:00'} struct DAYSAWAY 21 DEPARTDATE {ts '2010-03-10 00:00:00'} RETURNDATE {ts '2010-03-30 00:00:00'} On Tue, Mar 2, 2010 at 9:50 PM, Les Mizzell <lesm...@bellsouth.net> wrote: > > Kevin Pepperman wrote: >> I did not test it, but maybe try changing it to this? >> *<cfset req.daysAway = DateDiff("D",req.departdate,req.returndate)+1 >* > > Nope - that's not it... > > Here's a couple of test: > > March 9 to March 20 comes out incorrectly as 11 days > March 10 to March 20 comes out incorrectly as 10 days > March 10 to March 30 comes out *correctly* as as 21 days > > Checking the database - the dates ARE getting entered there correctly. > > > > __________ Information from ESET NOD32 Antivirus, version of virus signature > database 4910 (20100302) __________ > > The message was checked by ESET NOD32 Antivirus. > > http://www.eset.com > > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:331287 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm