I am calling a stored procedure from a data flow task in SSIS in which I am selecting the HOUR datepart of a datetime field. (code below from the stored procedure)
SELECT
DATEPART (HOUR, R.received_date) AS [Hour] ,
CONVERT (VARCHAR(10), R.received_date, 101) AS [Date] ,
COUNT (R.id) AS [NumberofFilings]
And in my data flow task, I have a OLE DB Source task in which I call the stored procedure:
And when I preview the data with the OLE DB source task, the data looks like I would expect - with the hour column displaying an integer between 0 & 24:
The issue occurs after I export the results to a CSV file and the hour becomes a datetime field where the values become '1/11/1900 0:00' which is not what I'm expecting.
In my flat file destination connection manager, I set the Hour properties to be four-byte signed integer but the hour will not display as an integer but as a datetime.
I've tried other datatypes for the Hour column but nothing will convert this to a single integer / character. Any suggetions?



