I would like to append the data in a SAS dataset to a table in a MS Access database. In the past, I've used a SQL INSERT INTO statement to do this, but I'm having some trouble with inserting the SAS date field into the MS Access Date/Time field. Here's an idea of what I'm trying do in the SAS program:
libname input "c:\Folder";
libname db access 'C:\Folder\database.accdb';
Proc SQL;
Create table tblAccess as
Select distinct field1, field2, DOS
from input.dat1;
PROC SQL;
Insert into db.tblClaims (field1, field2, DOS)
select field1, field2, DOS
from work.tblAccess;
The problem with this is that the DOS field is showing up as "1/1/1960 5:52:XX AM" in the MS Access database, regardless of what the DOS was originally. Obviously, the issue is that the SAS date is being entered into MS Access as a datetime - the SAS date of 12/10/2017 is being stored as the numeric 21163, which is being inserted into the MS Access DB as 21,163 seconds (~5 hours, 52 minutes) from 1/1/1960. In other words, somewhere along the way, my days are being treated as seconds, throwing everything off, if that makes sense.
But while I understand the issue, I can't seem to figure out how to fix it. Alternatively, I'd appreciate suggestions for other ways to approach this task that avoids this date/time field issue. As far as I can tell, PROC EXPORT won't work because the exported SAS dataset replaces the MS Access table and can't append to it, at least from my experiments with it.
Edit: the SAS field is DATE9. and the MS Access field is Date/Time, in case that's relevant.