Date Format in a Query Output

jbesr1230

Board Regular
Joined
Oct 16, 2004
Messages
96
Hello,
I query a linked table that has dates in mm/dd/yyyy format. I would like the output of the query to return the dates with month and year only i.e. 11/2004 or Nov-2004 etc. What would be a way to do this? Is there code that I can put in Field Property? Can I nest or concatenate the Functions Month and Year with the expression builder?
Thanks
JBESr
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
In your query, go to the field where you are pulling date.

I'm going to assume your date field is called [date], adjust as necessary.

Replace the direct reference to the field with an expression, so, where you have this:
[date]
in your query, replace with:
newDate: format([date], "mmm-yyyy")
or
newDate: format([date], "mm/yyyy")

The name 'newDate' is arbitrary, it's simply the column header for this expression field, you can change it to anything (but the name of the referenced field - this creates a circular reference).
 
Upvote 0

Forum statistics

Threads
1,221,831
Messages
6,162,252
Members
451,757
Latest member
iours

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