[Webinar] Streamline your web hosting managementRegister Today

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

DateTime format problem

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
ndornack
Asked:
ndornack
2 Solutions
 
Rey Obrero (Capricorn1)Commented:
try replacing your Expr1 with


[PunchDate]+[PunchTime] AS Expr1
0
 
mbizupCommented:
Try this expression to get PunchDT in the same format as Expr1:

Format(PunchDT, "mm/dd/yyyy hh:nn")
0
 
Rey Obrero (Capricorn1)Commented:
or this

Expr1: CDate(Format([PunchDT],"mm/dd/yyyy hh:nn:ss"))
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
Rey Obrero (Capricorn1)Commented:
@miriam,

why was the other Q of ndornack deleted?
0
 
mbizupCommented:
It duplicated an ongoing discussion in an earlier question in progress.
0
 
Rey Obrero (Capricorn1)Commented:
where is the question? please post warning comments prior to deletion of q.
0
 
mbizupCommented:
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
 
ndornackAuthor Commented:
Thanks for your help mbizupn and capricorn1.  Greatly appreciated and I needed a working solution today, so I can move on.
0
 
mbizupCommented:
ndornack,

 Glad we could help out.
0
 
Gustav BrockCIOCommented:
This should be enough:

Expr1: CDate([PunchDT])

/gustav
0

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

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