You are correct!  It does take the string value of date and time returned by
the TO_CHAR() SQL function in my query and format it using the DateFormat or
TimeFormat CF functions with mask values.

Thanks for pointing that out.  Thanks to Douglas who also provided help.


Bruce

----- Original Message -----
From: "Chris Lofback" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Tuesday, July 09, 2002 10:30 AM
Subject: RE: Retrieving Time in a Query


> The following snippet is working correctly for me (using Oracle 8i and
CF5):
>
> <CFQUERY NAME="GetMsgs" DATASOURCE="#DSN#" DBTYPE="#DSNType#">
> SELECT TO_CHAR(time_stamp,'MM/DD/YYYY HH24:MI') TimeStamp,
> display_text
> FROM itime_messages
> ORDER BY time_stamp DESC
> </CFQUERY>
>
> <CFOUTPUT QUERY="GetMsgs">
> <P><B>Posted #DateFormat(TimeStamp)# at #TimeFormat(TimeStamp)#
> EST</B>
> <BR>#ParagraphFormat(HTMLEditFormat(display_text))#
> </CFOUTPUT>
>
> Date and time are properly formatted with no extra parsing being done.
> Apparently CF5's date and time formatting can handle the TO_CHAR version
of
> the date.
>
> Chris Lofback
> Sr. Web Developer
>
> TRX Integration
> 28051 US 19 N., Ste. C
> Clearwater, FL  33761
> www.trxi.com
>
>
>
> -----Original Message-----
> From: Bruce Holm [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, July 09, 2002 1:33 PM
> To: CF-Talk
> Subject: Re: Retrieving Time in a Query
>
>
> If I try #parseDateTime(date)# where date is the column name containing an
> Oracle date/time object, I get:
>
> {ts '2002-07-08 00:00:00'}
>
> As you can see, the time is not there, it contains 7:00 am in my example.
>
> Bruce
>
> ----- Original Message -----
> From: "Douglas Brown" <[EMAIL PROTECTED]>
> To: "CF-Talk" <[EMAIL PROTECTED]>
> Sent: Tuesday, July 09, 2002 10:15 AM
> Subject: Re: Retrieving Time in a Query
>
>
> > Not sure, I do not use Oracle...and did not have to use a SQL function
> first
> > to get the desired result. all I did was a regular select and use
> > parseDateTime()
> >
> >
> >
> >
> > Douglas Brown
> > Email: [EMAIL PROTECTED]
> > ----- Original Message -----
> > From: "Bruce Holm" <[EMAIL PROTECTED]>
> > To: "CF-Talk" <[EMAIL PROTECTED]>
> > Sent: Tuesday, July 09, 2002 10:01 AM
> > Subject: Re: Retrieving Time in a Query
> >
> >
> > > This does work, but is there a more efficient (direct) way of doing
this
> > > without using a SQL function and a CF function?
> > > If not I'll go with this.
> > >
> > > In my query I specify one of the columns as:
> > >
> > >     TO_CHAR(event_start,'MM/DD/RR HH24:MI') testDateTime
> > >
> > > Then in CF I use:
> > >
> > > #parseDateTime(qGetResItem.testDateTime)#
> > >
> > > and it returns a date/time object:  {ts '2002-07-08 07:00:00'}
> > >
> > > Seems a long way around.  Why can't CF query get the date/time object
> WITH
> > > the time in it???
> > >
> > > Bruce
> > >
> > >
> > > ----- Original Message -----
> > > From: "Douglas Brown" <[EMAIL PROTECTED]>
> > > To: "CF-Talk" <[EMAIL PROTECTED]>
> > > Sent: Tuesday, July 09, 2002 9:47 AM
> > > Subject: Re: Retrieving Time in a Query
> > >
> > >
> > > > Can't you use parseDateTime(date)
> > > >
> > > >
> > > >
> > > >
> > > > Douglas Brown
> > > > Email: [EMAIL PROTECTED]
> > > > ----- Original Message -----
> > > > From: "Douglas Brown" <[EMAIL PROTECTED]>
> > > > To: "CF-Talk" <[EMAIL PROTECTED]>
> > > > Sent: Tuesday, July 09, 2002 9:39 AM
> > > > Subject: Re: Retrieving Time in a Query
> > > >
> > > >
> > > > > Cant you do dateFormat(date,"dd-mm-yyyy") timeFormat(date,
> "hh:mm:ss")
> > > What
> > > > > happens when you do this?
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > Douglas Brown
> > > > > Email: [EMAIL PROTECTED]
> > > > > ----- Original Message -----
> > > > > From: "Bruce Holm" <[EMAIL PROTECTED]>
> > > > > To: "CF-Talk" <[EMAIL PROTECTED]>
> > > > > Sent: Tuesday, July 09, 2002 9:32 AM
> > > > > Subject: Retrieving Time in a Query
> > > > >
> > > > >
> > > > > > How do you get the "time" portion of a DateTime object stored in
> an
> > > Oracle
> > > > > > database?
> > > > > >
> > > > > > I have a column in a table that is of type "date".  I can query
> this
> > > field
> > > > > > and view the date portion but the time portion is always 0:00
> (12:00
> > > AM).
> > > > > > The time IS reallly stored in the column, but the query CF does
> only
> > > gets
> > > > > > the date portion.  It appears to be getting the default Oracle
db
> > > value of
> > > > > > the date portion combined with 0:00 for time.
> > > > > >
> > > > > >
> > > > > > -------------------------------------------------
> > > > > > Bruce Holm - Web Programmer
> > > > > > Lattice Semiconductor Corp.
> > > > > > [EMAIL PROTECTED]
> > > > > > -------------------------------------------------
> > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>
> 
______________________________________________________________________
Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to