I am pulling the CreationTime of a message in Outlook and putting it into an Access table. I want to see if it already exists in the table.
(The format for CreationTime looks like this 3/29/2012 10:35:03 AM. It is saved in a date field with the format set to general date.) The data exists in the Access table so the recordcount should be returning a one instead of a zero. How should the varDateTime be handled in the sql string?
dim varDateTime as date
varDateTime = oMsg.CreationTime
sSQL = "SELECT tblOutlookData.CreationTime, tblOutlookData.CapExID" _
& " FROM tblOutlookData" _
& " WHERE tblOutlookData.CreationTime=" _
& "#" & varDateTime & "#"