need programming help w/coldfusion

TechBoyJK

Lifer
Oct 17, 2002
16,699
60
91
hi, i have users input their birthday via 3 fields, birthday_day, birthday_month, and birthday_year. They are all drop downs selects with the standard months, days, and years... I then need to combine that info into a single ms-sql datetime variable.. i also need to then compare that variable so that I can tell if the user is under 18 or not.. I'm a little confused as to lay out the code... here is what I have so far.. its not perfectly written cause im looking for help with the flow logic...

<CFSET createodbcdatetime(birthday_date) = "#birthday_day#-#birthday_month#-#birthday_year#">

<CFSET _member_age=datediff(now(), #birthday_date#)

<CFIF member_age LT 18 ><CFSET under_18_error = 1>