Solved

DateTime format problem

Posted on 2013-05-23
10
302 Views
Last Modified: 2013-05-24
I have this data:
I need to make "Expr1" be in the same format as "PunchDT" so I can perform a comparison?

ID      EmpNum      PunchDT      Expr1
2151      00027      5/22/2013 5:58:00 AM      05/22/2013 05:58
2152      00027      5/22/2013 3:30:00 PM      05/22/2013 15:30
2153      00027      5/23/2013 5:58:00 AM      05/23/2013 05:58
2154      00028      5/22/2013 5:36:00 AM      05/22/2013 05:36
2155      00028      5/22/2013 4:35:00 PM      05/22/2013 16:35
0
Comment
Question by:ndornack
10 Comments
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 39191745
try replacing your Expr1 with


[PunchDate]+[PunchTime] AS Expr1
0
 
LVL 61

Assisted Solution

by:mbizup
mbizup earned 250 total points
ID: 39191757
Try this expression to get PunchDT in the same format as Expr1:

Format(PunchDT, "mm/dd/yyyy hh:nn")
0
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 250 total points
ID: 39191770
or this

Expr1: CDate(Format([PunchDT],"mm/dd/yyyy hh:nn:ss"))
0
The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 39192270
@miriam,

why was the other Q of ndornack deleted?
0
 
LVL 61

Expert Comment

by:mbizup
ID: 39192313
It duplicated an ongoing discussion in an earlier question in progress.
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 39192402
where is the question? please post warning comments prior to deletion of q.
0
 
LVL 61

Expert Comment

by:mbizup
ID: 39192839
Rey,

This was the original:
http://www.experts-exchange.com/Microsoft/Development/MS_Access/Q_28137114.html

The DCount issue came up as a follow up within the original thread (a typo in my first comment), and was actually resolved by Pete's comment.  

Fwiw, your post and sample did not resolve the issue in that question of getting the output to match the spreadheet's format - there was another extraneous space in the query that needed to be removed (you can probably see this in the database you downloaded).

I posted an admin comment in the other question explaining the reason for the deletion.  That comment is visible to the author even though the question is deleted - but my intent was to start the four-day auto delete rather than immediately delete it.  Apologies for that.

Anyhow, if you have further issue with this feel free to contact me offline or use the Request Attention button if you want someone else to look at it.
0
 

Author Comment

by:ndornack
ID: 39193130
Thanks for your help mbizupn and capricorn1.  Greatly appreciated and I needed a working solution today, so I can move on.
0
 
LVL 61

Expert Comment

by:mbizup
ID: 39193135
ndornack,

 Glad we could help out.
0
 
LVL 49

Expert Comment

by:Gustav Brock
ID: 39193579
This should be enough:

Expr1: CDate([PunchDT])

/gustav
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Launch app from Access custom ribbon 8 33
Access sql to sql server express 10 32
Access on Mouse move 5 30
Binding recordsets to a form 6 22
Most if not all databases provide tools to filter data; even simple mail-merge programs might offer basic filtering capabilities. This is so important that, although Access has many built-in features to help the user in this task, developers often n…
I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
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…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

785 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