Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Division by zero 1

Status
Not open for further replies.

striker73

MIS
Jun 7, 2001
376
US
I have a form where a user can enter two dates, a starting and ending date, and then click a button and a report will be generated. I am creating filters in code on how the query should be filtered based on the dates entered. My sql filter statement ends up being something like:

SQT_str = "[Date] Between 3/1/00 And 6/1/00"

I use the following command to open the report with the filter:

DoCmd.OpenReport "MyReport", acPreview, , SQL_str

I am getting an error message that says I am trying to divide by zero. The line the error occurs is the DoCmd line. Any ideas? Thanks!!!
 
You have to surround your dates with # to have the jet manage them properly, other wise it tries to divide.

3 divided by 1 divided by 00 = Zero Error!

Try this instead:

SQT_str = "[Date] Between #3/1/00# And #6/1/00#"

HTH

Joe Miller
joe.miller@flotech.net
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top