MsLady
Traumatized by Access
- Local time
- Yesterday, 20:15
- Joined
- Jun 14, 2004
- Messages
- 438
I want to insert data into a table where a symbol does not already exist for that date. I am not sure what i am doing anymore So please help me verify that this won't insert duplicates? Am i using the correct logic?
Code:
"INSERT INTO StocksData (Symbol, [Security Name], [Market Category], " & _
"[Reg SHO Threshold Flag], FileDate) " & _
"SELECT DISTINCT Symbol, [Security Name], [Market Category], " & _
"[Reg SHO Threshold Flag], '" & fileDate & "'" & _
"FROM " & sTableName & _
" WHERE ((Symbol Not In (select Symbol from StocksData)) AND (" & _
fileDate & " Not In (select FileDate from StocksData)));"