If you want to continue using the <cftable> and <cfgrid>, then format the
data in your SQL. As Ben says, let the database do the work!
In Oracle I would do it with: select nvl(datefield, '-') datefieldalias
What this does is check for a null value in the datefield and return a dash
if it is null (or return whatever you want to display). If it is not null
then it returns the datefield. The alias is required or your column name
would be nvl(datefield,'-'). There should be a similar Foxpro SQL function,
or something like Access' iif statement.
Dan
-----Original Message-----
From: Jennifer [mailto:[EMAIL PROTECTED]]
Sent: Friday, July 07, 2000 9:13 AM
To: [EMAIL PROTECTED]
Subject: Re: Why does blank dates default to 1899-12-30?
HOLD! Don't panic. This can be done. Don't give up yet.
At 10:18 AM 7/7/00 -0400, you wrote:
>Hi Michael,
>
>Thanks for the suggestion. This is very bad news. My app displays the
status
>of a list of insurance policies for a particular piece of property: Date
>Issued, Date Canceled, Date Expired. Most of the time the last two are
>blank. And there may be from 1 to 9 policies listed for a property: General
>Liability, Auto, Umbrella, etc. I don't believe that I can insert CFIF tags
>within CFTable or CFGrid. The only workaround for me (other than to use
ASP)
>is to convert all date fields to text fields. This is possible now because
I
>prepare a special data file for web access. If I were allowing the clients
>to hit the live database, which is in future plans, I may not be able to
use
>CF.
>
>I'm don't believe I can use <TABLE> because there is no functions available
>to format date and dollar amounts.
ColdFusion has functions to format dates and dollar amounts. They can be
used outside other CF functions or within them. There is a DateFormat
function and a DollarFormat function. You can use those just about
anywhere. I've never used CFTable, personally. I just looked up some info
on it and it seems as though most of the functionality can be done with
<table> (according to CFWACK it may even look better with <table>). The
main differences between <table> and <cftable> are that you don't have to
put HMTL in <cftable> and that <cftable> doesn't actually output HTML, so
if the user doesn't have proper browser that doesn't matter.
> Other than that, this app was done and
>ready to go live Monday. What a kick in rear. Thanks again. Have a nice
day.
>See you Tuesday eve.
>
>Regards,
>
>Paige
>
>
>
>----- Original Message -----
>From: Michael Smith <[EMAIL PROTECTED]>
>To: <[EMAIL PROTECTED]>
>Sent: Friday, July 07, 2000 12:04 AM
>Subject: Re: Why does blank dates default to 1899-12-30?
>
>
> >
> > --------------106E292EBC4B30F10F8DC269
> > Content-Type: text/plain; charset=us-ascii
> > Content-Transfer-Encoding: 7bit
> >
> > I had the same problem with FoxPro 2.0 data. The workaround I came up
with
>was to not display dates older than 1901:
> >
> > <cfif year(followup) gt
>1901>#DateFormat(followup,'dd-mm-yyyy')#</cfif>
> > I was displaying the date field directly, not using CFGrid, so your
milage
>may vary...
> >
> > - Michael Smith, TeraTech http://www.cfconf.org/
> > MDCFUG http://www.cfug-md.org/
> >
> > Paige Chandler wrote:
> >
> > > This is a multi-part message in MIME format.
> > >
> > > ------=_NextPart_000_0009_01BFE76E.D7462320
> > > Content-Type: text/plain;
> > > charset="iso-8859-1"
> > > Content-Transfer-Encoding: quoted-printable
> > >
> > > Hi All,
> > >
> > > I'm "Selecting * From..." using a Visual FoxPro free table. Some of
the
>=
> > > date fields (VFP date format) are blank. When displayed with CFTable
or
>=
> > > CFGridCol they appear "1899-12-30". I must resolve this. Any =
> > > suggestions? TIA.
> > >
> > > Regards,
> > >
> > > Paige
> > >
------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.