Question
Problem with Date Comparison
I have an input on a form set to default to todays date. I
want to check to see if the date is less than todays date and if so
just set it to todays date. I cannot figure out how to do this.
Here is my code.
<body>
<cfset todayDate = now()>
<cfquery name="suidsearch" datasource="bldgaccess">
select * from SU_IDs
where EmpNumber = '#suid#'
</cfquery>
<table border="0" cellpadding="0" cellspacing="0" width="1109" leftmargin="0">
<tr>
<td width="84" height=21 class=pad5 style="BORDER-TOP: #ccc 1px dotted; font-weight:bold"><span class="pad5" style="BORDER-TOP: #ccc 1px dotted; font-weight:bold"><cfoutput>#form.suid#</cfoutput></span></td>
<td width="104" align="left" class=pad5 style="BORDER-TOP: #ccc 1px dotted; font-weight:bold"><span class="pad5" style="BORDER-TOP: #ccc 1px dotted; font-weight:bold"><cfoutput>#form.Name#</cfoutput></span></td>
<td width="161" height=21 align="left" class=pad5 style="BORDER-TOP: #ccc 1px dotted; font-weight:bold"><span class="pad5" style="BORDER-TOP: #ccc 1px dotted; font-weight:bold"><cfoutput>#form.bldgarea#</cfoutput></span></td>
<td width="760" align="left" class=pad5 style="BORDER-TOP: #ccc 1px dotted; font-weight:bold"><cfoutput>#form.schedule#</cfoutput></td>
</tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="1109" leftmargin="0">
<tr>
<td width="89" class=pad5>Start Date </td>
<td width="104" class=pad5>Exiration Date </td>
<td width="916" colspan="2" class=pad5> </td>
</tr>
<tr>
<form name="form3" method="post" action="confirmation.cfm" target="_self"><td height=21 class=pad5 style="BORDER-TOP: #ccc 1px dotted">
<cfoutput>
<input type="text" name="startdate" style="width:60" value="#dateFormat( todayDate, "mm/dd/yyyy" )#">
</cfoutput>
If anyone has any ideas I would appreciate it. Thanks!
<body>
<cfset todayDate = now()>
<cfquery name="suidsearch" datasource="bldgaccess">
select * from SU_IDs
where EmpNumber = '#suid#'
</cfquery>
<table border="0" cellpadding="0" cellspacing="0" width="1109" leftmargin="0">
<tr>
<td width="84" height=21 class=pad5 style="BORDER-TOP: #ccc 1px dotted; font-weight:bold"><span class="pad5" style="BORDER-TOP: #ccc 1px dotted; font-weight:bold"><cfoutput>#form.suid#</cfoutput></span></td>
<td width="104" align="left" class=pad5 style="BORDER-TOP: #ccc 1px dotted; font-weight:bold"><span class="pad5" style="BORDER-TOP: #ccc 1px dotted; font-weight:bold"><cfoutput>#form.Name#</cfoutput></span></td>
<td width="161" height=21 align="left" class=pad5 style="BORDER-TOP: #ccc 1px dotted; font-weight:bold"><span class="pad5" style="BORDER-TOP: #ccc 1px dotted; font-weight:bold"><cfoutput>#form.bldgarea#</cfoutput></span></td>
<td width="760" align="left" class=pad5 style="BORDER-TOP: #ccc 1px dotted; font-weight:bold"><cfoutput>#form.schedule#</cfoutput></td>
</tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="1109" leftmargin="0">
<tr>
<td width="89" class=pad5>Start Date </td>
<td width="104" class=pad5>Exiration Date </td>
<td width="916" colspan="2" class=pad5> </td>
</tr>
<tr>
<form name="form3" method="post" action="confirmation.cfm" target="_self"><td height=21 class=pad5 style="BORDER-TOP: #ccc 1px dotted">
<cfoutput>
<input type="text" name="startdate" style="width:60" value="#dateFormat( todayDate, "mm/dd/yyyy" )#">
</cfoutput>
If anyone has any ideas I would appreciate it. Thanks!