I have a tiny little schedule program that runs from MS SQL Server. This is
very simple.

In it the user enters an EventDetail, EventDate, EventStartTime and
EventEndTime. The date and time fields in SQL are DateTime datatype.

As I insert or update the records I use a CreateODBCDate for the EventDate
and CreateODBCTime for times. I use CFFORM to validate the date and time
formats.

INSERT QUERY
        <cfquery datasource="#application.dsn#" name="qryUpdate">
        UPDATE tblGradOrientation
        SET
                EventDate = #CreateODBCDate(EventDate)#,
                EventStartTime = #CreateODBCTime(EventStartTime)#,
                EventEndTime = #CreateODBCTime(EventEndTime)#,
                EventType = #EventType#,
                EventDetail = '#EventDetail#'
        WHERE GradOrientationID = #GradOrientationID#
        </cfquery>

The resulting data looks like this:
GID  EventDate   EventStartTime       EventEndTime         EventDetail
EventType
12   08/23/00    6/20/00 9:00:00 AM   6/20/00 9:50:00 AM
<b>Opening&nbsp;Remarks</b> 1


****************************************************************************
***************
In the output I sort it on first the EventDate, then the start times.

OUTPUT QUERY
<cfquery name="qryGetGradEvents" datasource="#application.dsn#"
dbtype="ODBC" timeout="30" debug>
        SELECT tblGradOrientation.*, EventDate, EventStartTime,
            EventType
        FROM tblGradOrientation
        ORDER BY EventDate, EventStartTime
</cfquery>

****************************************************************************
***************
Problem:
Example: When you insert (or update) a record to the system, it shows the
the EventDate in the database as 08/25/00. The times, however, show as
6/20/00 9:00:00 AM and 6/20/00 10:00:00 AM, showing the date the data was
entered. Output is fine at this point if all the data for that EventDate are
entered on the same day (06/20/00).

If someone updates the record on another day, say 06/21/00, the sorting gets
screwy. It now puts all times with the new, updated date in the EventStart
and StopTime fields at the end.

Question:
Is there a simple way to store JUST the time in a DateTime datatype field. I
would have thought that is what CreateODBCTime was for, but apparently not.
Or should I just use a char field for this.

Sorry if this is too much detail or messy. Please feel free to contact me
off-list.

Gary McNeel, Jr.
Project Manager - DAC-Net, Research & Graduate Studies
Rice University - Houston
[Lovett Hall] 713-348-6266 (Primary)
[DAC] 713-348-5184
[M] 713-962-0885
[H] 713-723-9240

"Great spirits have always encountered violent opposition from mediocre
minds."
   -Albert Einstein

------------------------------------------------------------------------------
Archives: http://www.eGroups.com/list/cf-talk
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.

Reply via email to