94Sport5sp
Registered User.
- Local time
- Yesterday, 21:35
- Joined
- May 23, 2012
- Messages
- 115
Hi:
I have a select query to display record from a table. I would like to lookup the closing value for the corresponding record for yesterday. I have coded the following DLookup to get that data and it works if I hard code the date. Now I need to change it to be current date of current record minus 1. So far it is not working. Here is the working DLOOKUP
DLookUp("CloseInv","Stocktbl","GroupDept =" & [GroupDept] & " and int(SaleDate) = #4/30/2012#") AS EndInv
In the above SaleDate is the date for the current record and I would like SaleDate -1 to equal 4/30/2012 in the above example
DLookUp("CloseInv","Stocktbl","GroupDept =" & [GroupDept] & " and int(SaleDate) = " & Int(Saledate -1) ") AS EndInv
returns a zero value.
SaleDate is a full date plus time and the time for what I want is not relevant.
What am I missing?
Thanks
I have a select query to display record from a table. I would like to lookup the closing value for the corresponding record for yesterday. I have coded the following DLookup to get that data and it works if I hard code the date. Now I need to change it to be current date of current record minus 1. So far it is not working. Here is the working DLOOKUP
DLookUp("CloseInv","Stocktbl","GroupDept =" & [GroupDept] & " and int(SaleDate) = #4/30/2012#") AS EndInv
In the above SaleDate is the date for the current record and I would like SaleDate -1 to equal 4/30/2012 in the above example
DLookUp("CloseInv","Stocktbl","GroupDept =" & [GroupDept] & " and int(SaleDate) = " & Int(Saledate -1) ") AS EndInv
returns a zero value.
SaleDate is a full date plus time and the time for what I want is not relevant.
What am I missing?
Thanks