Month name of date field in Access database from external application (C#)
I want to populate a drop down list at runtime in C#. I have a Date/Time field (e.g., 01/05/2000) in an Access 2003 database. I want to have the month name (i.e. January, February, ...) in the drop down list at runtime. SELECT DISTINCT MonthName(Month(DATE_OF_BOOKING)) AS MNTH FROM TRAVEL_DETAILS WHERE YEAR(DATE_OF_BOOKING)='2008' The above query works fine while I'm running it from Access directly, but when I'm trying to run it from an OledbCommand object in C# it says Undefined function 'MonthName' in expression. Text from social msdn thread : Custom user-written VBA functions as well as