Displaying the month

K

KayC

In a query, i have a field defined as

Month: DatePart("m",[Date of Call])

I want the month to be displayed spelled out, so i tried
to make it "mmmm" but it says "this expression is typed
incorrectly, or it is too complex to be evaluated. For
example, a numeric expression may contain too many
complicated elements. Try simplifying the expression by
assigning parts of the expression to variables."

First of all, what does that mean. And secondly, how can
i make it so that it shows up as "January" instead of "1"
on a report?
 
J

Jeff Conrad

Hi,

Instead of using the DatePart function why not use the Format property?

Change the query field to this:

Month: Format([Date Of Call],"mmmm")

Worked in my quick test.
Also, since Month is a reserved Access word you might want to use a
different name to avoid problems later.

Hope that helps,
Jeff Conrad
Bend, Oregon
 
D

Dirk Goldgar

KayC said:
In a query, i have a field defined as

Month: DatePart("m",[Date of Call])

I want the month to be displayed spelled out, so i tried
to make it "mmmm" but it says "this expression is typed
incorrectly, or it is too complex to be evaluated. For
example, a numeric expression may contain too many
complicated elements. Try simplifying the expression by
assigning parts of the expression to variables."
First of all, what does that mean.

In this case, what it really means is that "mmmm" is not a valid
argument to the DatePart function, so the query is getting an error back
from the expression service.
And secondly, how can
i make it so that it shows up as "January" instead of "1"
on a report?

Month: Format([Date of Call], "mmmm")
 
F

fredg

In a query, i have a field defined as

Month: DatePart("m",[Date of Call])

I want the month to be displayed spelled out, so i tried
to make it "mmmm" but it says "this expression is typed
incorrectly, or it is too complex to be evaluated. For
example, a numeric expression may contain too many
complicated elements. Try simplifying the expression by
assigning parts of the expression to variables."

First of all, what does that mean. And secondly, how can
i make it so that it shows up as "January" instead of "1"
on a report?
The error message is a generic message telling you that you didn't
write the function correctly, and Access hasn't a clue as to what you
mean.

To display the full month name of a Date Datatype field, all you need
do is write
mmmm
in the Format property line of the control.

Or .... if you were using a calculated control you would use, as it's
control source:
=Format([DateOfCall],"mmmm")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top