DatePart or multi parameter functions return invalid comma error

F

Frankie0042

Hi

I have a problem with all the versions of Access after 2000. It seems that a
change was made in the way functions work. If you pass in 2 or more
parameters you now have to separate them with spaces instead of commas. Even
when I use spaces, this still gives me an error. The Northwind sample
database also has this error. I have installed all of the service packs and
bug fixes and I still get this problem.

For example:

select DatePart("q",[OrderDate],1,0) from Orders

or

DatePart("q" [OrderDate] 1 0)

both report the second parameter as an error. In fact any functions with
more than one parameter has this problem.

Are you not allowed to have more than one parameter in these versions of
Access? Or what is the correct syntax? Why does the Northwind database not
use the correct syntax?

If you're trying to duplicate the error, use the "Quarterly Orders by
Product" query in the Northwind sample database. You might have to go in and
out of the design window and query window to get the error.

Thanks
Francois
 
R

Roger Carlson

Before you go any further, check your References. Go to any code window and
choose Tools > References. See if any of them are marked as MISSING.
Uncheck that one (make a note of what it is first) and then close the
window. Test to see if your DatePart problem still occurs. When you have a
missing reference, it can often manifest itself as an error in many of the
"built-in" functions.
 

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

Top