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.

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

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)
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.