access 2007 rejecting format to group by year

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm looking at moving Access 2002 to 2007. There's a database query to
extract accounting records and grouping/totalling by year. 2007 rejects the
format as 'Undefined function format$. It's -
Field: Date By Year: [Format$]([Accounts - account transactions].Date,"yyyy")
Total: Group by
Any ideas why? Thanks. John
 
What's with the square brackets around the function name?

Try:
Format([Accounts - account transactions].[Date],"yyyy")

If that still fails, try adding your database folder as a trusted location
under:
Office Button | Access Options | Trust Center | Trust Center Settings

Date is not a good name for a field. It is a reserved word in JET (query
engine) and in VBA (for the system date), so is likely to cause you issues.
The square brackets around the field name (as above) may help, but it would
be a good idea to rename the field.

For a list of all the field names to avoid, see:
http://allenbrowne.com/AppIssueBadWord.html
 
Thanks, Allen, that did it. I'm selftaught with Access to help a non-profit.
I can do quite a lot but appreciate the quick, expert help available on these
forums.
John

Allen Browne said:
What's with the square brackets around the function name?

Try:
Format([Accounts - account transactions].[Date],"yyyy")

If that still fails, try adding your database folder as a trusted location
under:
Office Button | Access Options | Trust Center | Trust Center Settings

Date is not a good name for a field. It is a reserved word in JET (query
engine) and in VBA (for the system date), so is likely to cause you issues.
The square brackets around the field name (as above) may help, but it would
be a good idea to rename the field.

For a list of all the field names to avoid, see:
http://allenbrowne.com/AppIssueBadWord.html


--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

john said:
I'm looking at moving Access 2002 to 2007. There's a database query to
extract accounting records and grouping/totalling by year. 2007 rejects
the
format as 'Undefined function format$. It's -
Field: Date By Year: [Format$]([Accounts - account
transactions].Date,"yyyy")
Total: Group by
Any ideas why? Thanks. John
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Update SQL through a form combo box 12
Group dates 1
Grouping By Date 1
Parameter Error for Year 2010 7
making age group query work 7
month-year format 2
Group By Question? 1
Access not recognizing Date Format 3

Back
Top