Skip to main content
Inspiring
May 24, 2006
Question

Displaying Time Problem w/MySQL CFMX7

  • May 24, 2006
  • 3 replies
  • 738 views
Greetings -

Using
-- MySQL
-- CFMX7

I have a report designed which collects the time the report was done. This
field is filled in by an individual. The form field is validated for time entry.

On the insert query, the input is coded as:
--> #CreateODBCTime(form.ReportTime)#

MySQL DB Field:
--> Name: ReportTime
--> Type: Time
--> Format: HH:MM:SS
--> Default: <NULL>

When I look at the individual record in DB I see the time as:
--> 15:21:00

When I output the time on a page (without formatting) I get this:
--> {ts '1970-01-01 00:00:00'}

When I output the time on a page (with formatting) I get this:
--> 00:00:00

What am I doing wrong? What am I missing?

Leonard B
    This topic has been closed for replies.

    3 replies

    Inspiring
    May 25, 2006
    Yep, Good call!
    Inspiring
    May 24, 2006
    its seems to me the input "form.ReportTime" is not in right format. If you can seperate each elemate out that would be even better. then you could use the Create time function: CreateTime(form.hour, form.minute, form.second)

    As long as the input is current you should be able to do what your doing.
    May 24, 2006
    The easiest thing to do is to change your select statement like so:
    SELECT
    CAST (TimeColumn AS CHAR (15)) AS TimeStr
    From ...
    Where ... etc.


    Or you could use TimeFormat() when displaying the value.
    Leonard_BAuthor
    Inspiring
    May 24, 2006
    Hi MikerRoo

    I tried your suggestion and I got an error message of
    --> Variable TIMESTR is undefined

    What did I miss with your suggestion?

    == also ==

    When I output the time on a page (with formatting) I get this:
    --> 00:00:00 -used- #TimeFormat(ReportTime, "HH:MM")#

    Leonard B


    May 24, 2006
    There is something else going on here.

    What version of MySql are you using?

    Also, please attach the exact code and exact error message.

    Thanks,
    -- MikeR