General discussion

Locked

Access - Date Function causes Division b

By kkenkel513 ·
I have two computers that exhibit this same problem and I don't know how to solve it. The line of code is :

Set validrec = db.OpenRecordset("SELECT ValidationRunDates.ValidationDate FROM ValidationRunDates WHERE (((ValidationRunDates.ValidationDate)=" & Date & "));")

The error is Division by Zero, which makes NO sense to me in this context. We've even tried reloading Access thinking that one of the DLL files had become corrupt.

Any suggestions would be greatly appreciated!

This conversation is currently closed to new comments.

5 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

Access - Date Function causes Division b

by acwiz In reply to Access - Date Function ca ...

I assumed Validrec is a recordset. Try the line as written below. You were missing the # (tells it is a date) and the () after Date. I tried it and it reads the recordset.
Set validrec = db.OpenRecordset("SELECT ValidationRunDates.ValidationDate FROM ValidationRunDates WHERE (((ValidationRunDates.ValidationDate)=#" & Date() & "#));")

Collapse -

Access - Date Function causes Division b

by kkenkel513 In reply to Access - Date Function ca ...

Poster rated this answer

Collapse -

Access - Date Function causes Division b

by dmiles In reply to Access - Date Function ca ...

This may help,you will have to load the Date Migration Wizard and make sure it is Y2K Compliant.
To install date migration tool,download the DM2.EXE file from the Microsoft Software Library,Install the files.
Choose Date Migration from the Tools menu,choose Date Fix Wizard from the submenu
Click Next in the first Date Wizard Dialog Box.
See KB article Q124365
Related KB article Q214331

Collapse -

Access - Date Function causes Division b

by kkenkel513 In reply to Access - Date Function ca ...

Poster rated this answer

Collapse -

Access - Date Function causes Division b

by kkenkel513 In reply to Access - Date Function ca ...

This question was closed by the author

Back to Software Forum
5 total posts (Page 1 of 1)  

Related Discussions

Related Forums