Complicated Query

kc1

Registered User.
Local time
Today, 01:47
Joined
Sep 22, 2008
Messages
23
Hi

Can anyone help me with why this expression in a query keeps returning an error.

Expr2: IIf(IsError(MonthName(Mid([tbl_NewPRDdetails]![Month],3,2))),MonthName(Mid([tbl_NewPRDdetails]![Month],4,1)),MonthName(Mid([tbl_NewPRDdetails]![Month],3,2)))

I am trying to return the month name (October) from dates (01/10/08)

Can anyone help

Thanks
 
With Mid("01/10/08",3,2) you extract two characters starting with the third one what gives you "/1". Certainly not what you want. Please describe the error in more detail if this does not fix your problem.

Thomas
 
Try;

Code:
=MonthName(Month([YourControlName]),False)

In the above argument False will return the full month name, whilst True will return the abbreviation of the month name. If that part of the argument is not provided the default is False.
 

Users who are viewing this thread

Back
Top Bottom