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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access Query--Call Procedure Invalid

Status
Not open for further replies.

ghcrazy8

MIS
Apr 17, 2006
20
0
0
US
I just started a new job and I'm hoping this is a simple adjustment that needs to be made to my Access software, but I'm trying to create two fields off of a date field. The first field should be the month in month abbreviation format and the second field should be the year in YYYY format. I'm using the DatePart Function. Whenever I try to run the query, I get Call Procedure invalid. What's happening?

Here's my expression:
Month: DatePart("m",[expirationdate]+1)

Second Field:
Year: DatePart("yyy",[expirationdate]+1)

Thank you in advance for any help.

 
Access has a Month() function and a Year() function. Each of these accept a valid date value and return the month or year number. Your issue with DatePart() might be "yyyy" for the year.

If you don't want the month number, then you should tell us what specifically you mean by "month abbreviation format". If you mean Jan, Feb, Mar,... then use the Format() function.
Code:
 =Format(DateFieldExpression, "mmm")

Duane
Hook'D on Access
MS Access MVP
 
Thank you for your help.

For the month, I want the abbreviation (Jan, Feb, Mar).

Will this function (=Format(DateFieldExpression, "mmm") work if I'm trying to extract the month out of a date (1/1/2001) giving me Jan?

Sorry for not being more specific.

Leslie

 
ghcrazy8 said:
Will this function (=Format(DateFieldExpression, "mmm") work if I'm trying to extract the month out of a date (1/1/2001) giving me Jan?
It would take you less time to test it in your query/control source than it does to ask here. Also, I believe I answered this question previously.

Duane
Hook'D on Access
MS Access MVP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top