scripter73
Programmer
Hi,
I have the following code that receives a "date" from a user in piecemeal. "MM" is a text box, "DD" is a text box, and "YYYY" is a text box.
In my Cold Fusion code, I create a session variable called #session.lossdate# that concatenates the three parms taken from the URL.
I want to verify that I do indeed have a date format of YYYYMMDD.
I've tried to do the IsDate(#session.lossdate#) function, but I think my syntax's coming up short. Can someone help me out? I want to find out if what I currently have is a date, and if not, how can I make it a date?
Code follows:
<html>
<head><title>Date Manipulation</title></head>
<body>
<cfset #session.lossdate# = '#url.lossdate_year##url.lossdate_month##url.lossdate_day#'>
<cfquery name="losslook" datasource="wdata">
select wpol_policy_alpha,
wpol_policy_number,
wpol_renewal_seq_number,
wpol_endorsement_no,
wpol_eff_date,
wpol_exp_date,
wpol_endorse_date,
wpol_canc_eff_date,
wpol_rein_date
from PLWEBPOL02
where (wpol_policy_number = #session.policydigit#)
</cfquery>
Verify lossdate.<br>
Loss date is <cfoutput>#session.lossdate#</cfoutput>.
Is this viewed as a date? <cfoutput>IsDate("02/20/01"
</cfoutput><br>
</body>
</html>
Thanks in advance,
scripter73
I have the following code that receives a "date" from a user in piecemeal. "MM" is a text box, "DD" is a text box, and "YYYY" is a text box.
In my Cold Fusion code, I create a session variable called #session.lossdate# that concatenates the three parms taken from the URL.
I want to verify that I do indeed have a date format of YYYYMMDD.
I've tried to do the IsDate(#session.lossdate#) function, but I think my syntax's coming up short. Can someone help me out? I want to find out if what I currently have is a date, and if not, how can I make it a date?
Code follows:
<html>
<head><title>Date Manipulation</title></head>
<body>
<cfset #session.lossdate# = '#url.lossdate_year##url.lossdate_month##url.lossdate_day#'>
<cfquery name="losslook" datasource="wdata">
select wpol_policy_alpha,
wpol_policy_number,
wpol_renewal_seq_number,
wpol_endorsement_no,
wpol_eff_date,
wpol_exp_date,
wpol_endorse_date,
wpol_canc_eff_date,
wpol_rein_date
from PLWEBPOL02
where (wpol_policy_number = #session.policydigit#)
</cfquery>
Verify lossdate.<br>
Loss date is <cfoutput>#session.lossdate#</cfoutput>.
Is this viewed as a date? <cfoutput>IsDate("02/20/01"
</body>
</html>
Thanks in advance,
scripter73