Date format mm/yyyy

JPR

Registered User.
Local time
Yesterday, 19:08
Joined
Jan 23, 2009
Messages
216
Hello,
Is there a way a can show a date field in a query as mm/yyyy format?
The query has its recods source to a table with a regular date field (mm/dd/yyyy). I will be always entering data in the correct date format but would like to add ta column to a query with this other format- Thank you
 
Have you tried creating an additional column with the field in the Format() function?
DateMMYYYY: Format([DateField], "mm/yyyy")
 
Have you tried creating an additional column with the field in the Format() function?
DateMMYYYY: Format([DateField], "mm/yyyy")
I would expect not. :(
 
Hello,
Is there a way a can show a date field in a query as mm/yyyy format?
The query has its recods source to a table with a regular date field (mm/dd/yyyy). I will be always entering data in the correct date format but would like to add ta column to a query with this other format- Thank you
This display format would be for display only, though, correct?
 
Thank you.
Yes, the format is only to display data.
I have copied the code in a new column of the query but I am getting a sintax or missing operator error.
 
Thank you.
Yes, the format is only to display data.
I have copied the code in a new column of the query but I am getting a sintax or missing operator error.
Please show us the SQL from the query. Not a screenshot of the query designer. The copy and paste the SQL, please.
 
The query has its record source to table1 and has the following fields:

- DateCost
- Amount

Date cost has the format dd/mm/yyyy

This is the code in the new column:

Code:
DateMMYYYY: Format([DateCost], "mm/yyyy")

Thank you
 
Thank you.
Yes, the format is only to display data.
I have copied the code in a new column of the query but I am getting a sintax or missing operator error.
The Datefield needs to be the actual name of your date field?
 
The query has its record source to table1 and has the following fields:

- DateCost
- Amount

Date cost has the format dd/mm/yyyy

This is the code in the new column:

Code:
DateMMYYYY: Format([DateCost], "mm/yyyy")

Thank you
That *should* work?

This works for me. I even added an extra space after the comma, but Access removed it.
Code:
SELECT tblDaily.DailyID, Format([dailydate],"mm/yyyy") AS Expr1
FROM tblDaily;
1754146453507.png
 
The query has its record source to table1 and has the following fields:

- DateCost
- Amount

Date cost has the format dd/mm/yyyy

This is the code in the new column:

Code:
DateMMYYYY: Format([DateCost], "mm/yyyy")

Thank you
Given the snippet shown, it should work, but that is why we need to see the actual SQL, not parts of it.

The error about syntax or missing operator suggests the problem is elsewhere in that SQL, so that's what we need to evaluate.

Also, please confirm that DateCost is a datetime datatype field (I understand that the way it's formatted in the table implies it is, but just to be sure).
 
Finally got it to work. Not sure if it's because I use an Italian language of Access. This is how I changed it.
Code:
Expr1: Format([dailydate];"mm/aaaa")

Thank you
 
Finally got it to work. Not sure if it's because I use an Italian language of Access. This is how I changed it.
Code:
Expr1: Format([dailydate];"mm/aaaa")

Thank you
Well yes :(
It will be whatever your language settings are. :(

I presume 'a' is for ano's? :unsure: Other languages use ; instead of ' as separators. I am suprised you have not come upon that in the past as you have been given Format() in other threads you have posted?

Lucky for you, months are the same as in English. :)
 
Finally got it to work. Not sure if it's because I use an Italian language of Access. This is how I changed it.
Code:
Expr1: Format([dailydate];"mm/aaaa")

Thank you
Yes, language settings matter.
 
Actually year is Anno.
Ano ........totally different meaning.....:)
 
Actually year is Anno.
Ano ........totally different meaning.....:)
I just asked Alexa and that is what it sounded like to me. If it offended in any way (and a Google translate shows it could :( ), then I apologise. :)
 
Last edited:
Absolutely!!! No worries. It just made me have a good laugh!!
 

Users who are viewing this thread

Back
Top Bottom