Access 2013 Query Question - Convert Date Value to YYYY-MM Format in Query Results

RHONDAK72

Board Regular
Joined
Dec 26, 2007
Messages
133
Hi. I use MS Access 2013. I have a table the includes a date field. The format is Date/Time and dates are displayed in the field as mm/dd/yyyy (e.g. 01/31/2015) I want to be able to query on this field, but I want the query to return the YYYY-MM value for each date. For example, for date 01/31/2015, I want it to return 2015-01 in my query results. Is there an easy way to write an expression within Query Design View in order to get this result?

Thanks,
Rhonda
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
Sure. It will something like:
Code:
MyExpression: Format([DateField],"yyyy-mm")
 
Upvote 0
Here is a SQL Statement for that field only

SELECT Format([Field6],"mm-yyyy") AS Date3
FROM Sheet1;
 
Upvote 0

Forum statistics

Threads
1,214,950
Messages
6,122,438
Members
449,083
Latest member
Ava19

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top