Solved

Format date in access query

Posted on 2014-09-15
2
624 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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Any Way to Print an Import Spec? 3 30
Trying to open FORM in specific record !! 6 45
ms access filter query with empty combobox 5 29
is Microsoft Access going to Die? 9 48
The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

773 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