K
kurt.baker
Hi All,
I have many queries in an Access DB which for the most part works fine.
Except when I have any that use dates, several, not all of the PC's
here get the error:
Microsoft Access has encountered a problem and needs to close. We are
sorry for the inconvenience.
The info from the error:
AppName: msaccess.exe AppVer: 10.0.6771.0 ModName: vbe6.dll
ModVer: 6.4.99.72 Offset: 001b2b61
One example of a query (this is the shortest one, but others are
similar where they compare dates in one way or another).
(Query CompCount)
SELECT Job.Complete
FROM Job
WHERE (((Job.Complete)=1) AND ((Job.CompleteDate) Between #8/1/2006#
And #8/16/2006#));
Like I mentioned, not all of the PC's have this problem. They all have
Windows XP with current updates. We did put the latest Office SP on it
and it was no help. Even just opening the query to view the data causes
the error, it doesn't have to be run from any specific program.
I have tried to use Format() and that doesn't work. However, if I used
CVDate( #8/1/2006#), I can open the query, but when I run the
application that uses the dates, it changes it back to the original
query shown above, and up comes the error. The code that gets the error
is:
strSql = "SELECT DISTINCTROW [CompCount2].[CountOfComplete] AS Stuff
FROM [CompCount2];"
Set db = CurrentDb
Set rs = db.OpenRecordset(strSql, dbOpenSnapshot) ' <---actual error
line
CompCount2 is just another query to total the count found in the
failing query above
(SELECT Count(CompCount.Complete) AS CountOfComplete
FROM CompCount
So, does anyone have any ideas how to correctly use dates in a query?
All suggestions are appreciated. Thanks!
Kurt
I have many queries in an Access DB which for the most part works fine.
Except when I have any that use dates, several, not all of the PC's
here get the error:
Microsoft Access has encountered a problem and needs to close. We are
sorry for the inconvenience.
The info from the error:
AppName: msaccess.exe AppVer: 10.0.6771.0 ModName: vbe6.dll
ModVer: 6.4.99.72 Offset: 001b2b61
One example of a query (this is the shortest one, but others are
similar where they compare dates in one way or another).
(Query CompCount)
SELECT Job.Complete
FROM Job
WHERE (((Job.Complete)=1) AND ((Job.CompleteDate) Between #8/1/2006#
And #8/16/2006#));
Like I mentioned, not all of the PC's have this problem. They all have
Windows XP with current updates. We did put the latest Office SP on it
and it was no help. Even just opening the query to view the data causes
the error, it doesn't have to be run from any specific program.
I have tried to use Format() and that doesn't work. However, if I used
CVDate( #8/1/2006#), I can open the query, but when I run the
application that uses the dates, it changes it back to the original
query shown above, and up comes the error. The code that gets the error
is:
strSql = "SELECT DISTINCTROW [CompCount2].[CountOfComplete] AS Stuff
FROM [CompCount2];"
Set db = CurrentDb
Set rs = db.OpenRecordset(strSql, dbOpenSnapshot) ' <---actual error
line
CompCount2 is just another query to total the count found in the
failing query above
(SELECT Count(CompCount.Complete) AS CountOfComplete
FROM CompCount
So, does anyone have any ideas how to correctly use dates in a query?
All suggestions are appreciated. Thanks!
Kurt