Format DB Column Value Containing a Time Value

S

Steve

I'm using the Database Results Wizard to insert a field that contains a time
value in it. When the page is served up, it displays the hours, minutes,
and seconds (hh:mm:ss). Is there a way to format the database column value
so that only the hours and minutes are displayed?

Thanks!
 
J

Jim Buyens

-----Original Message-----
I'm using the Database Results Wizard to insert a field
that contains a time value in it. When the page is
served up, it displays the hours, minutes, and seconds
(hh:mm:ss). Is there a way to format the database column
value so that only the hours and minutes are displayed?

Yes. On page 2 of the wizard, click Custom Query and then
Edit. Then, change the reference to your field from:

SELECT ..., mytimefield, ...

to

SELECT ..., Format(mytimefield,"hh:ss") as fmttime, ...

Then, on page 3 of the wizard, click Edit List, delete the
old time field, and include the new fmttime field.

Jim Buyens
Microsoft FrontPage MVP
http://www.interlacken.com
Author of:
*----------------------------------------------------
|\---------------------------------------------------
|| Microsoft Office FrontPage 2003 Inside Out
||---------------------------------------------------
|| Web Database Development Step by Step .NET Edition
|| Microsoft FrontPage Version 2002 Inside Out
|| Faster Smarter Beginning Programming
|| (All from Microsoft Press)
|/---------------------------------------------------
*----------------------------------------------------
 
S

Steve

Thanks! This works great. However, it no longer displays AM or PM after
the time. Is there a way to correct this?
 
S

Steve

Thanks for the help. I figured it out!

Steve said:
Thanks! This works great. However, it no longer displays AM or PM after
the time. Is there a way to correct this?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top