Go to the module section. Create a new module and just paste this code
in there and save it - you can save the module as any name.
Function ConvertNumericT oDate(s1 as String) As Date
ConvertNumericT oDate = Format(s1, "mm/dd/yyyy")
End Function
Now go to the table you just imported from Excel. Add a new column and
make it a DateTime type. This column will be empty, but you are going
to update that column with the data from the Numeric Date column from
Excel.
Then go to the Queries section and open a new query in design view. Add
the table you just imported from Excel. Now go to the Query Menu at the
top of the Query Design view. Select "Update Query". Now, from the
Table in the Query Design view - scroll that table till you see your new
Date Column and drag your new Date column to the Field section in the
Query Design view. Place the Column in the cell next to "Field:" This
should automatically add the name of the Table in the "Table:" cell just
below the "Field:" cell.
Now go to the cell next to "Update To:" which is immediately below the
"Table:" cell
Here is where you type this:
ConvertNumericT oDate(theTableN ame.yourDateFie ldName)
replace theTableName with the actual table Name and replace
yourDateFieldNa me with the name of the actual Date field. Make sure you
type the tableName - period - DateFieldName
tblWhatever.Dat eFieldWhatever
Make sure this is inside parentheses after the Function Name
ConvertNumericT oDate(tblWhatev er.DateFieldWha tever)
That is what you type in the "Update To:" cell
Save the query and run it. This will update your new Date Column with
the Date value of the Numeric Dates.
Rich
*** Sent via Developersdex
http://www.developersdex.com ***