WannaLearn
Programmer
Is there anything wrong with this bit of code? I always get an error when someone tries to pass the date as 2/29/2005 or 2/30/2005.
<cfif myYear neq "" and myMonth neq "" and myDay neq "">
<cfset myDOB = myYear & "/" & myMonth & "/" & myDay>
<cfif not listfind("4,6,9,11",myMonth) and myDay neq "31">
<cfset myDOB = DateFormat(myDOB, "yy/mm/dd")>
<cfelseif not listfind("29,30,31",myDay) and myMonth neq "2">
<cfset myDOB = DateFormat(myDOB, "yy/mm/dd")>
<cfelse>
<cfset myDOB = "">
</cfif>
<cfelse>
<cfset myDOB = "">
</cfif>
Thanks.
<cfif myYear neq "" and myMonth neq "" and myDay neq "">
<cfset myDOB = myYear & "/" & myMonth & "/" & myDay>
<cfif not listfind("4,6,9,11",myMonth) and myDay neq "31">
<cfset myDOB = DateFormat(myDOB, "yy/mm/dd")>
<cfelseif not listfind("29,30,31",myDay) and myMonth neq "2">
<cfset myDOB = DateFormat(myDOB, "yy/mm/dd")>
<cfelse>
<cfset myDOB = "">
</cfif>
<cfelse>
<cfset myDOB = "">
</cfif>
Thanks.