Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Receive error on DatePart("mm",Anydate)

Status
Not open for further replies.

Shamous

IS-IT--Management
Jun 23, 2001
82
US
I get a runtime error "5". Illegal proceedure call or function call when runing the following in a QBE

DatePart("mm",anydate)

or
in the debug window.

?DatePart("MM",#04/09/1960#)


Any ideas why I get this error?
 

Use one M for the datepart if you want month.

?DatePart("m",#04/09/1960#)
Terry L. Broadbent
FAQ183-874 contains tips for posting questions in these forums.
NOTE: Reference to the FAQ is not directed at any individual.
 
Thanks, thats it. How would I then pad the 4 to be 04?
 
tlbroadbent, I still get the error with DatePart("y",#04/09/60#) or DatePart("yy",#04/09/60#)

what gives?

Thanks for your help
 

Access expects "year" or "yyyy" rather than "y" or "yy". Help isn't easy to use but it sure comes in handy when trying to learn syntax. Terry L. Broadbent
FAQ183-874 contains tips for posting questions in these forums.
NOTE: Reference to the FAQ is not directed at any individual.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top