First of all, what kind of a database lets you store no, N/A or a date in a
date field?  I find it hard to believe that you're using a date field in a
database.  Seems like you're storing strings.  First, you need to convert
the string to a date value.  I suggest using cftry:

<cfoutput>
        <cftry>
                #DateFormat(CreateDate(fieldName), 'mm/dd/yyyy')#
                <cfcatch type="any">#fieldName#</cfcatch>
        </cftry>
</cfoutput>

-----Original Message-----
From: Billy Ng [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, July 24, 2001 1:00 PM
To: CF-Talk
Subject: RE: date field


Can you do a IsDate() on the date field first
then if true -> output DateFormat(datefield)
if false -> output datefield

Billy

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: July 24, 2001 10:59 AM
To: CF-Talk
Subject: date field


I have a query that returns a field that is either a date or N/A or No or
Now. I want it to output the words if there is words and if there isnt then
do a dateformat on the date.  How can I do this?

Joshua
Tipton
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to