Log in
::
Register
::
Not logged in
Home
Tags
Articles
Editorials
Stairways
Forums
Scripts
Videos
Blogs
QotD
Books
Ask SSC
SQL Jobs
Training
Authors
About us
Contact us
Newsletters
Write for us
Recent Posts
Recent Posts
Popular Topics
Popular Topics
Home
Search
Members
Calendar
Who's On
Home
»
Data Warehousing
»
Integration Services
»
SSIS - datetime manipulation
SSIS - datetime manipulation
Rate Topic
Display Mode
Topic Options
Author
Message
musclewindows_25
musclewindows_25
Posted Tuesday, September 04, 2012 3:48 PM
Forum Newbie
Group: General Forum Members
Last Login: Tuesday, September 18, 2012 4:12 PM
Points: 2,
Visits: 11
Hi you all.
I have this task that I'm working on right now, which is to load flat file into an oracle table. I'm using SSIS to do the task.
My issue is the datetime column. The data is in eastern time and I want to convert it into either pacific or mountain time depending on the store number.
this is what I mean: If store_# is 100-400 then convert the time into pacific time
store_# 401-600 then convert time into mountain time
It is possible to do this in derived column? Please help. Thanks
Post #1354231
Evil Kraig F
Evil Kraig F
Posted Tuesday, September 04, 2012 4:20 PM
SSCertifiable
Group: General Forum Members
Last Login: Today @ 1:29 PM
Points: 5,678,
Visits: 6,128
Yes, but you'll end up doing it in a pair of derived structures because I can't remember offhand if you can embed an if-switch into the DATEADD function.
First, derive the column to a negative x numeric to pass to the next structure, which will dateadd( "h", <newcolumn>, <existingDateTime>)
That'll remove your hours. From there, format as needed to make Oracle happy.
- Craig Farrell
Never stop learning, even if it hurts. Ego bruises are practically mandatory as you learn unless you've never risked enough to make a mistake.
For better assistance in answering your questions
|
Forum Netiquette
For index/tuning help, follow these directions.
|
Tally Tables
Twitter: @AnyWayDBA
Post #1354242
musclewindows_25
musclewindows_25
Posted Wednesday, September 05, 2012 9:18 AM
Forum Newbie
Group: General Forum Members
Last Login: Tuesday, September 18, 2012 4:12 PM
Points: 2,
Visits: 11
Something like this?
Storeno >= 100 && Storeno <= 400 ? DateAdd("hh",ABS(DateDiff("hh", GetDate(), GetUTCDate()) - 5), DateAdd("mm", -7.00 * 60, GetUTCDate())) : DateAdd("hh",ABS(DateDiff("hh", GetDate(), GetUTCDate()) - 5), DateAdd("mm", -8.00 * 60, GetUTCDate()
Post #1354653
« Prev Topic
|
Next Topic »
Permissions
You
cannot
post new topics.
You
cannot
post topic replies.
You
cannot
post new polls.
You
cannot
post replies to polls.
You
cannot
edit your own topics.
You
cannot
delete your own topics.
You
cannot
edit other topics.
You
cannot
delete other topics.
You
cannot
edit your own posts.
You
cannot
edit other posts.
You
cannot
delete your own posts.
You
cannot
delete other posts.
You
cannot
post events.
You
cannot
edit your own events.
You
cannot
edit other events.
You
cannot
delete your own events.
You
cannot
delete other events.
You
cannot
send private messages.
You
cannot
send emails.
You
may
read topics.
You
cannot
rate topics.
You
cannot
vote within polls.
You
cannot
upload attachments.
You
may
download attachments.
You
cannot
post HTML code.
You
cannot
edit HTML code.
You
cannot
post IFCode.
You
cannot
post JavaScript.
You
cannot
post EmotIcons.
You
cannot
post or upload images.
Copyright © 2002-2013 Simple Talk Publishing. All Rights Reserved.
Privacy Policy.
Terms of Use.
Report Abuse.