Solved

How display part of a date/time value on a form?

Posted on 2014-04-21
5
362 Views
Last Modified: 2014-04-21
On a form I have a date/time field that displays like this:

4/18/2014 8:28:03 AM

But I want it to display like:

4/18/2014 8:28 AM  (with no seconds showing)

Now can I do that?

--Steve
0
Comment
Question by:SteveL13
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 38

Expert Comment

by:PatHartman
ID: 40012673
You will need to define a custom format for the control.

m/d/yyyy h:nn
0
 

Author Comment

by:SteveL13
ID: 40012767
Tried that.  It still displays the seconds.

??
0
 
LVL 38

Expert Comment

by:PatHartman
ID: 40012782
If you don't have to update the value, apply the format in the RecordSource query.

Select ...., Format(yourdate, "m/d/yyyy h:nn") as formattedDate, ....
0
 

Author Comment

by:SteveL13
ID: 40012816
Here is my SQL view but it doesn't seem to like it...

SELECT tblLaborTranx.LaborTranxID, tblEmployees.FullName, tblLaborTranx.StartTime, Format(StartTime, "m/d/yyyy h:nn") as formattedStartTime,tblLaborTranx.StopTime; Format(StopTime, "m/d/yyyy h:nn") as formattedStopTime
FROM tblLaborTranx LEFT JOIN tblEmployees ON tblLaborTranx.EmployeeID = tblEmployees.EmployeeID
ORDER BY tblEmployees.FullName;
0
 
LVL 38

Accepted Solution

by:
PatHartman earned 500 total points
ID: 40012977
What error message are you getting?  If it is a message about duplicate names, then fully qualify the field names with table names when you use them in a function.

, Format(tblLaborTranx.StartTime, "m/d/yyyy h:nn") as formattedStartTime
0

Featured Post

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you need a simple but flexible process for maintaining an audit trail of who created, edited, or deleted data from a table, or multiple tables, and you can do all of your work from within a form, this simple Audit Log will work for you.
This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

630 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question