Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / SQL Server / ADP / December 2005

Tip: Looking for answers? Try searching our database.

format time

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
JEM - 01 Dec 2005 16:03 GMT
Hi.  I have a combo box that is based on a view. The combo displays a
beginning time and an end time for a class.  I have the datetime field
converted so that it displays only the time as such: CONVERT(nchar(20),
dbo.tblClasses.BegTime, 108) AS Beg_Time.  This displays the time in
military format like 13:00:00. I would like it to show 1:00 PM instead.
Anyone know how to do this? Thanks.

Jenn
giorgio rancati - 01 Dec 2005 17:04 GMT
Hi JEM,

try this
----
RIGHT(CONVERT(varchar,dbo.tblClasses.BegTime, 0),7)
----

bye
Signature

Giorgio Rancati
[Office Access MVP]

> Hi.  I have a combo box that is based on a view. The combo displays a
> beginning time and an end time for a class.  I have the datetime field
[quoted text clipped - 4 lines]
>
> Jenn
JEM - 01 Dec 2005 17:53 GMT
Thanks!  It works great.
JEM - 01 Dec 2005 20:20 GMT
Hi again. I wonder if you would have another quick solution for me...in
the same combo box, i show the cost for the class which is a money
column.  In the display of the combo box it shows fine: $250.00.  But,
on my form, i have an unbound text box that displays the cost after a
class is chosen from the combo box. But, it is not displaying it
properly, it is showing 250.  I formatted the text box as currency and
even tried using a custom format $###.00 but i still just get 250.  Any
ideas?
giorgio rancati - 02 Dec 2005 11:17 GMT
Hi JEM.

Put in textbox's controlsource
----
=Val(Str([ComboBox].[Column](1)))
----
(check column number)
and put Currency in its Format properties

Bye
Signature

Giorgio Rancati
[Office Access MVP]

> Hi again. I wonder if you would have another quick solution for me...in
> the same combo box, i show the cost for the class which is a money
[quoted text clipped - 4 lines]
> even tried using a custom format $###.00 but i still just get 250.  Any
> ideas?
giorgio rancati - 02 Dec 2005 11:27 GMT
ops.
It's sufficient
----
=Val([ComboBox].[Column](1))
----

bye
Signature

Giorgio Rancati
[Office Access MVP]

giorgio rancati - 02 Dec 2005 11:54 GMT
ops.
In US currency it's sufficient
----
=Val([ComboBox].[Column](1))
----

bye
--
Giorgio Rancati
[Office Access MVP]
JEM - 02 Dec 2005 17:41 GMT
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.