Ok Greg, I went ahead and just stuck the code and explanation into a blog post since it was kind of long.
http://www.codersrevolution.com/index.cfm/2009/9/7/Phone-Plan-Matchup-SQL-Brute-Force-Method Keep in mind this really just one way to do it, and it might not be the best. I also considered using some recursion to generate the possible combinations in CF, but this method was a little easier. Use it as a starting point or don't use it at all. :) Thanks. ~Brad -------- Original Message -------- Subject: Re: getting min value based on inputs From: Greg Morphis <gmorp...@gmail.com> Date: Sun, September 06, 2009 10:20 am To: cf-talk <cf-talk@houseoffusion.com> The idea is that all lines add up to the total minutes entered in any possible way because in the end they'll share the minutes. 1 line at 10,000 minutes would fail because there are no plans of that size. Priority is on cost, not so much on minutes. For example if you entered 9100 minutes and 10 lines the solution would return 9200 minutes. I'll have to get the exact plans/minutes on Tuesday to provide the solution. And if multiple options add up to the same cost then yeah, one at random would work because it meets the requirements. Thanks! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| 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:326070 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4