Transaction Date

mugman17

Registered User.
Local time
Today, 21:48
Joined
Nov 17, 2000
Messages
110
I have a query where the user enters the transaction date through a form. It then totals everything given that date. How would I go about having it give totals for the day before the selected date. Pretty simple I'm sure, cant get it to work though. Would it be (transaction date - 1)or something?
 
Copy the query re-name it change the criteria as you suggested, you'll have to use DLookup or a subform to display the information.
 
I have tried this before, but I am getting a too complicated error when I use this to get the day before totals under criteria in Transaction Date.

[Forms]![frmDates]![txtStartDate]-1
 
Try using the dateadd() function to specify the form date - 1, e.g. (this will work in Northwind 'as is')

SELECT Orders.OrderID, Customers.CompanyName, Orders.OrderDate
FROM Customers INNER JOIN Orders ON Customers.CustomerID = Orders.CustomerID
WHERE (((Orders.OrderDate)=DateAdd("d",-1,[forms]![DateRange]![From])))
ORDER BY Orders.OrderDate;
 

Users who are viewing this thread

Back
Top Bottom