Solved How to display month and year only on report? (1 Viewer)

Missomissou

Member
Local time
Today, 05:25
Joined
Jan 30, 2024
Messages
51
Hello, I've created a query to return monthly updates for the past three months for a number of projects. It's working beautifully, but I would like the report to display only the month and year of the update. The day is superfluous. I found a number of threads that suggested using the following expression in the query: =Format([Updatedate, "mmmm yyyy"). It appears to me that the end bracket is missing in this expression, but in any case, whether I enter that in there or not, I'm getting some very strange results. It may be that I've put the expression in the wrong place? I tried pasting it into the property sheet. That caused it to go haywire. Here's a picture:
1706911775982.png
and didn't work. I also tried putting it into the query column, that created a syntax error:
1706911907586.png
. And finally, I tried I tried pasting it into the sort row. That result isn't worth posting. Any ideas what's going on here?
 

moke123

AWF VIP
Local time
Today, 07:25
Joined
Jan 11, 2013
Messages
3,920
?format(date, "mmmm yyyy")
February 2024
 

Gasman

Enthusiastic Amateur
Local time
Today, 12:25
Joined
Sep 21, 2011
Messages
14,305
I have no idea as to why you have all those quotes in the expression?
Care to show where you obtained that syntax?
 

MajP

You've got your good things, and you've got mine.
Local time
Today, 07:25
Joined
May 21, 2018
Messages
8,529
When you apply formatting in the property sheet of a form you supply only the format string without quotes. The property is a string. There is no equal sign and no Format. Simply
Code:
Format: mmmm yyyy

Since you pasted
=Format([someValue],"mmmm yyyy")

It has no idea what you are trying to do and converts to the following
"=For"m"at(["s\om"eValue],mmmm yyyy)"

I have some guesses why it breaks it up like that but not certain. It is making its best guess at the string you provided

In a query you use the format function to create a calculated field as already shown. However you type the alias of the new field first followed by colon and no equal sign

Code:
FormattedUpdate: Format([SomeField],"mmmm yyyy")

The equal sign would only be used on a value like a calculated control
Code:
controlSource: =Format([someField],"mmmm yyyyy")
 
Last edited:

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 19:25
Joined
May 7, 2009
Messages
19,244
format is Display only. when you Enter that field/textbox it will show in real date form.
fmt.png
 

Users who are viewing this thread

Top Bottom