Solved

Format date in access query

Posted on 2014-09-15
2
637 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
[X]
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
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

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

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

As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

728 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