Wrox Programmer Forums
|
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 24th, 2005, 02:09 PM
Authorized User
 
Join Date: Dec 2004
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Default Time Question on SQL/ASP

Have field displaying time from a dattime field. Have been trying to figure out how [u]not</u> to show the seconds on time format.
Currently shows: 09:00:00 AM
Want to show: 09:00 AM

Any help would be appreciated.

Thanks

Mike
__________________
Mike
 
Old January 24th, 2005, 02:20 PM
Friend of Wrox
 
Join Date: Dec 2004
Posts: 307
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Vadivel Send a message via Yahoo to Vadivel
Default

I guess you need to make use of FormatDateTime(Date,4) or something similar

Best Regards
Vadivel

MVP ASP/ASP.NET
http://vadivel.thinkingms.com
 
Old January 24th, 2005, 02:21 PM
Friend of Wrox
 
Join Date: Dec 2004
Posts: 307
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Vadivel Send a message via Yahoo to Vadivel
Default

or try this ... formatdatetime(now(),vbshortdate)

Best Regards
Vadivel

MVP ASP/ASP.NET
http://vadivel.thinkingms.com
 
Old January 24th, 2005, 03:13 PM
Authorized User
 
Join Date: Dec 2004
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for the input vadivel, but i need it to be in regular time and for it show AM/PM without the seconds only.

Mike
 
Old January 24th, 2005, 11:48 PM
Friend of Wrox
 
Join Date: Dec 2004
Posts: 307
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Vadivel Send a message via Yahoo to Vadivel
Default

Assign the value of formatdatetime(now(), vbshortdate) to a variable .. lets say "TimeValue". Then make use of the following "if" loop to identify whether it is a AM or PM.

Dim strTemp

if DatePart("h", TimeValue) >= 12 then
 strTemp = "PM"
Else
 strTemp = "AM"
End if

Note: This is what struck me immediately after seeing your response. Just check out whether there are anyother better approach.

Best Regards
Vadivel

MVP ASP/ASP.NET
http://vadivel.thinkingms.com





Similar Threads
Thread Thread Starter Forum Replies Last Post
ASP/SQL question dathomps Classic ASP Databases 5 December 4th, 2007 07:38 PM
ASP / Sql question joebeem Classic ASP Basics 0 August 28th, 2007 02:45 PM
time in sql server is not real time hertendreef SQL Server 2005 6 April 19th, 2007 07:07 AM
question about login and "remember me next time" hertendreef ASP.NET 2.0 Professional 0 February 14th, 2007 07:29 AM
another question..this time about data enviroment. smileii VB Databases Basics 0 October 18th, 2006 12:50 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.