Hi Kim,
Create a UDF (User defined function) that returns the trade date from the NYSE Trades table and use it in a query.
In a standard module, paste this code;
Code:
Public Function GetTradeDate(pDate As Date)
Dim R As DAO.Recordset
Dim sSQL As String
GetTradeDate = Null
sSQL = "SELECT TOP 1 NYSETrades.NYSE_ID, NYSETrades.TradingDate"
sSQL = sSQL & " FROM NYSETrades"
sSQL = sSQL & " WHERE NYSETrades.TradingDate >= #" & pDate & "#;"
Set R = CurrentDb.OpenRecordset(sSQL)
If Not R.BOF And Not R.EOF Then
R.MoveFirst
GetTradeDate = R!TradingDate
End If
R.Close
Set R = Nothing
End Function
The query would look like this:
SELECT TOP 1 Vesting.EmpID, Vesting.VestDate, GetTradeDate([vestdate]) AS TradeDate
FROM Vesting;
You will have to use your field names and add any other fields you need in the query.
Without your field names and some sample data, this is as close as I can get with the code.