1,105,625 Community Members

Undefined function 'MonthName' in expression in c# stored query

Member Avatar
jlivvers
Light Poster
26 posts since Oct 2010
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

Hi

I have a c# console app that calls some access 2007 queries. One of these queries throws an error "Undefined function 'MonthName' in expression".

I understand that some functions that are available in VBA cant be called from c# and if i comment out the 'monthname' function the call works fine. However it would be better if i could find a way to work round the issue instead of deleting the function.

Can anyone shed any light?

Many thanks.

Member Avatar
Momerath
Senior Poster
3,831 posts since Aug 2010
Reputation Points: 1,327 [?]
Q&As Helped to Solve: 664 [?]
Skill Endorsements: 19 [?]
Featured
 
0
 

What's the query and can't you just get the month name in C# if you need to?

Member Avatar
jlivvers
Light Poster
26 posts since Oct 2010
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

What's the query and can't you just get the month name in C# if you need to?

Hi Momerath,

yes I think that may be the way to go. I was just wondering if there was something in c# that i was missing!

The query is below

GFMonthName: IIf([Frequency]=1 And [Type]="Regular",MonthName(DatePart("m",[DD Start Date])),Null)
You
This article has been dead for over three months: Start a new discussion instead
Post:
Start New Discussion
View similar articles that have also been tagged: