If you want the current date to be your starting point, and you want
them to select a date in the future using your dropdowns, you'd do this:
<!--- Create a new date object based on user selections --->
<cfset newDate =
DateAdd('d',day_value,DateAdd('m',month_value,DateAdd('yyyy',year_value,now())))>
<!--- find the difference --->
<cfset diff = DateDiff('d',now(),newDate)>
Essentially, if the user selected 2 years, 3 months and 15 days, the
newDate would be 12/17/2010 which is 836 days away.
Hope that helps. If not, please clarify your goal a little more.
Jake Churchill
CF Webtools
11204 Davenport, Ste. 100
Omaha, NE 68154
http://www.cfwebtools.com
402-408-3733 x103
Laurie Smith wrote:
>> I have 3 drop-down boxes for:
>> Years
>> Months
>> Days
>>
>> I need to combine the values for all 3 and convert to days so I can
>> use the total number of days with DateDiff...Any suggestions would be
>> greatly appreciated. Thanks
>>
>
> I should have clarified that I am not passing a date such as mm/dd/yyyy. The
> year dropdown contains the values 1-5 that the user can select, the month is
> 1-11, and the days are 1-30. What I am trying to do is for example, when if a
> user selects 2 years 2 months 2 days then I need to convert those values to
> days.
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to
date
Get the Free Trial
http://ad.doubleclick.net/clk;203748912;27390454;j
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:311925
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4