Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 379
  • Last Modified:

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

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
SteveL13
Asked:
SteveL13
  • 3
  • 2
1 Solution
 
PatHartmanCommented:
You will need to define a custom format for the control.

m/d/yyyy h:nn
0
 
SteveL13Author Commented:
Tried that.  It still displays the seconds.

??
0
 
PatHartmanCommented:
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
 
SteveL13Author Commented:
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
 
PatHartmanCommented:
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

Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now