Solved

Format date in access query

Posted on 2014-09-15
2
615 Views
Last Modified: 2014-09-15
Experts,

Is there a way to format a date inputted as 20140101 to 2014-01-01 in an SQL statement in MS Access?
0
Comment
Question by:morinia
2 Comments
 
LVL 21

Accepted Solution

by:
Randy Poole earned 500 total points
ID: 40323285
I assume that is a string?  Select Left(yourfield,4)+'-'+Mid(yourfield,5,2)+'-'+Right(yourfield,2) as yourdate from yourtable
0
 
LVL 24

Expert Comment

by:Phillip Burton
ID: 40323301
Assuming "20140101" has been inputed as a date or datetime, then Format(<<field name>>,"yyyy-mm-dd") should work.

If it is a string, then Randy's answer is correct.
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Today's users almost expect this to happen in all search boxes. After all, if their favourite search engine juggles with tens of thousand keywords while they type, and suggests matching phrases on the fly, why shouldn't they expect the same from you…
In Debugging – Part 1, you learned the basics of the debugging process. You learned how to avoid bugs, as well as how to utilize the Immediate window in the debugging process. This article takes things to the next level by showing you how you can us…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

708 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now