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 derfloh 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 with dates

Status
Not open for further replies.

EddStewart

Programmer
Joined
Nov 9, 2000
Messages
3
Location
GB
Hi, I have a problem with Access VBA that has me stuck so if anyone can help me, I would be most grateful:

Set rstDest = db.OpenRecordset("SELECT * FROM TotaledOrders WHERE OrderDate = " & rstSrc!DateOrdered)

Here I am trying to create/open a recordset containing all records with an OrderDate of rstSrc!DateOrdered using SQL. The table TotaledOrders sometimes contains matching records, sometimes not. If there are no matches then the program runs fine, however if a match is found, it drops out with Division by Zero Error.

If anyone has any idea as to what it might be then please respond.

Thankyou very much,
Edd Stewart
 
What is the source for the value in rstSrc!DateOrdered?


Larry De Laruelle
larry1de@yahoo.com

 
You have to put the date like this #01/01/2000#. The # sign must go around date musch the same as quotes go around strings. Durkin
alandurkin@bigpond.com
 
Good catch Durkin...


Terry M. Hoey
th3856@txmail.sbc.com

Ever notice that by the time that you realize that you ran a truncate script on the wrong instance, it is too late to stop it?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top