Can I convert int date to smalldatetime?

Last Post 24 Aug 2009 10:30 AM by bmwdks. 5 Replies.
AddThis - Bookmarking and Sharing Button
Author Messages
bmwdks
New Member
New Member

--
24 Aug 2009 07:42 AM
I have 2 tables with their date columns defined as int and the data is in the format of yyyymmdd.

I tried to modify the table but get conversion errors.

Can I conver that int date to a smalldatetime column instead?

Thanks,
Rob
bmwdks
New Member
New Member

--
24 Aug 2009 10:15 AM
Thanks Russell. That's awesome, that worked. One other quick question though.
What do I need to do with my load data in order for it to load correctly? I load on an hourly basis from an updated flat file and it's just a number in the flat file: 20090824

Thanks!
bmwdks
New Member
New Member

--
24 Aug 2009 10:30 AM
Never mind. I forgot I need to change my package to recognize that field as a datetime instead of an integer. Thanks again for your help!
bmwdks
New Member
New Member

--
24 Aug 2009 12:02 PM
Hey Russell,
Still having trouble getting new data loaded into the now smalldatetime field. It's just in integer form 20090824. Tried it just as is, then tried it with single quotes around it. Using DT_DBDATE as my column def on the packing import.

Any suggestions there?

Thanks!
bmwdks
New Member
New Member

--
25 Aug 2009 09:28 AM
Great info! Thanks again!
bmwdks
New Member
New Member

--
25 Aug 2009 10:41 AM
I changed my input data to be 2009-08-25 and it went into the smalldatetime as 8/24/2009 12:00:00 which I don't care about the time anyway, so that's fine. But I'm still glad to know that convert info too!


Acceptable Use Policy
---