Undefined 'Date' function in Access
debutant
-
mihego32 Posted messages 40 Status Membre -
mihego32 Posted messages 40 Status Membre -
Hello,
I just took over an Access database in my company and I didn't have time for a handover with the person who was previously in charge of the database because she left my company suddenly.
Here is my problem: since Friday, I've been getting the following message when I want to run a query:
Error '3085'
Function 'Date' not defined
yet this application has been running for a long time and there have been no recent changes, and the 'Date' function is a standard function in Access, so I don't understand anything.
Since I've never worked on ACCESS, I have no idea which direction to take to resolve this issue, so I'm relying on your enlightened opinions to help me out.
Thank you in advance
I just took over an Access database in my company and I didn't have time for a handover with the person who was previously in charge of the database because she left my company suddenly.
Here is my problem: since Friday, I've been getting the following message when I want to run a query:
Error '3085'
Function 'Date' not defined
yet this application has been running for a long time and there have been no recent changes, and the 'Date' function is a standard function in Access, so I don't understand anything.
Since I've never worked on ACCESS, I have no idea which direction to take to resolve this issue, so I'm relying on your enlightened opinions to help me out.
Thank you in advance
Configuration: Windows XP Firefox 2.0.0.11
7 réponses
Hi,
Try using two Date() parentheses, or use Now; it normally also gives the system date and time.
Otherwise, provide more details (code snippet or location of the error - form, queries -).
Try using two Date() parentheses, or use Now; it normally also gives the system date and time.
Otherwise, provide more details (code snippet or location of the error - form, queries -).
Hello,
the parentheses are on Date()
here is the code:
DoCmd.OpenQuery ("Req_Select_BI_Legio_Sup_J-2_Lancement")
and here is the query:
SELECT Tab_Prélèv.Date_prél, Min(Tab_Prélèv.Heure_Prél) AS MinDeHeure_Prél, Tab_Prélèv.Num_Dossier, Count(Tab_Prélèv.Num_Prélèv) AS CompteDeNum_Prélèv, Tab_Dossier.Chargémission
FROM Tab_Prélèv INNER JOIN Tab_Dossier ON Tab_Prélèv.Num_Dossier = Tab_Dossier.Num_dossier
GROUP BY Tab_Prélèv.Date_prél, Tab_Prélèv.Num_Dossier, Tab_Dossier.Chargémission
HAVING (((Tab_Prélèv.Date_prél)=Date() Or (Tab_Prélèv.Date_prél)=Date()-1 Or (Tab_Prélèv.Date_prél)=Date()-2))
ORDER BY Tab_Prélèv.Date_prél, Min(Tab_Prélèv.Heure_Prél), Tab_Prélèv.Num_Dossier;
the parentheses are on Date()
here is the code:
DoCmd.OpenQuery ("Req_Select_BI_Legio_Sup_J-2_Lancement")
and here is the query:
SELECT Tab_Prélèv.Date_prél, Min(Tab_Prélèv.Heure_Prél) AS MinDeHeure_Prél, Tab_Prélèv.Num_Dossier, Count(Tab_Prélèv.Num_Prélèv) AS CompteDeNum_Prélèv, Tab_Dossier.Chargémission
FROM Tab_Prélèv INNER JOIN Tab_Dossier ON Tab_Prélèv.Num_Dossier = Tab_Dossier.Num_dossier
GROUP BY Tab_Prélèv.Date_prél, Tab_Prélèv.Num_Dossier, Tab_Dossier.Chargémission
HAVING (((Tab_Prélèv.Date_prél)=Date() Or (Tab_Prélèv.Date_prél)=Date()-1 Or (Tab_Prélèv.Date_prél)=Date()-2))
ORDER BY Tab_Prélèv.Date_prél, Min(Tab_Prélèv.Heure_Prél), Tab_Prélèv.Num_Dossier;
already tried,
the maintenance function works but it doesn't give me what I want, however Date is still not recognized? why?
the maintenance function works but it doesn't give me what I want, however Date is still not recognized? why?
Why it doesn't work: I don't know?
But Now should give the same result!
In any case: you can do your own testing:
Create a new query,
Choose SQL mode,
Test the queries:
Select Date();
And
Select Now;
And you will see if the problem lies in the functions and not in the tables!
But Now should give the same result!
In any case: you can do your own testing:
Create a new query,
Choose SQL mode,
Test the queries:
Select Date();
And
Select Now;
And you will see if the problem lies in the functions and not in the tables!
OK thanks!!!
Otherwise, I found the solution, actually there was a missing dll (pdf.ocx) in preferences that has nothing to do with the Date function but it prevented it from working properly.
Otherwise, I found the solution, actually there was a missing dll (pdf.ocx) in preferences that has nothing to do with the Date function but it prevented it from working properly.
Same error message
Resolved. It was a DLL issue concerning me (sqldistx.dll). So I opened the Visual Basic window, then Tools, then References, and I specified the correct path of the DLL in question.
For more explanation:
There you go, hoping this helps ;)
Resolved. It was a DLL issue concerning me (sqldistx.dll). So I opened the Visual Basic window, then Tools, then References, and I specified the correct path of the DLL in question.
For more explanation:
http://office.microsoft.com/en-us/access-help/undefined-function-problems-and-references-to-undefined-projects-or-libraries-HP003084429.aspx
There you go, hoping this helps ;)
Hi,
I just stumbled upon the same problem while "updating" a 2008 DB that used RTF2 (rich text management for memo fields before Access 2007): the Date() function in queries is an undefined function.
It’s correct to point out the absence of a reference, but it’s different from those mentioned in previous posts. With VBA and Access 2010 (Win10), the appropriate reference (for my case in January 2017) is:
Microsoft Visual Basic for Applications Extensibility 5.3
Oufti! There you go hoping this is useful ;) (Bis)
Michel-H. G11
I just stumbled upon the same problem while "updating" a 2008 DB that used RTF2 (rich text management for memo fields before Access 2007): the Date() function in queries is an undefined function.
It’s correct to point out the absence of a reference, but it’s different from those mentioned in previous posts. With VBA and Access 2010 (Win10), the appropriate reference (for my case in January 2017) is:
Microsoft Visual Basic for Applications Extensibility 5.3
Oufti! There you go hoping this is useful ;) (Bis)
Michel-H. G11