W
wizcow2
Guest
Hi, I have a query wich returns the results I want.
I am trying to put it into code, so I copied from the sql pane.
But my result is always 12:00PM.
What am I doing wrong here?
Tom
I am trying to put it into code, so I copied from the sql pane.
But my result is always 12:00PM.
What am I doing wrong here?
Dim ld As Date
Dim stsql As String
Dim msg As VbMsgBoxResult
stsql = "SELECT TOP 1 Inventory.StockTakeDate" & _
"FROM Inventory INNER JOIN InventorySub ON Inventory.InventoryID = InventorySub.InventoryID " & _
"WHERE (InventorySub.ItemNo) = [Forms]![part]![Item No] " & _
"ORDER BY Inventory.StockTakeDate DESC;"
stsql = ld
msg = MsgBox("last inventory date was " & ld & " 2003", vbOKOnly)
Tom