Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win


DateTime format problem

Posted on 2013-05-23
Medium Priority
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
Question by:ndornack
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
LVL 120

Expert Comment

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

[PunchDate]+[PunchTime] AS Expr1
LVL 61

Assisted Solution

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

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

Accepted Solution

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

Expr1: CDate(Format([PunchDT],"mm/dd/yyyy hh:nn:ss"))
NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 39192270

why was the other Q of ndornack deleted?
LVL 61

Expert Comment

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

Expert Comment

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

Expert Comment

ID: 39192839

This was the original:

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.

Author Comment

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

Expert Comment

ID: 39193135

 Glad we could help out.
LVL 52

Expert Comment

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

Expr1: CDate([PunchDT])


Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This article describes two methods for creating a combo box that can be used to add new items to the row source -- one for simple lookup tables, and one for a more complex row source where the new item needs data for several fields.
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
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…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

610 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