|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Monday, May 20, 2013 2:01 AM
Points: 8,
Visits: 37
|
|
im developing an ssis package.
while im in the sql server , there is a field that contains a text string , for example:
December 13, 2008
and so on...
i want to convert it to 2008-12-13 00:00:00.000 or 2008-12-13 (its same for me)
so, in the sql server i can do it with this statement:
SELECT convert(datetime,myfiled, 107)
FROM ....
the question is , what is the equivalent statement to it within the SSIS 2008 ? (with derived column)
thank you
|
|
|
|
|
Right there with Babe
      
Group: General Forum Members
Last Login: Yesterday @ 12:57 PM
Points: 740,
Visits: 790
|
|
avishain (1/21/2013) im developing an ssis package.
while im in the sql server , there is a field that contains a text string , for example:
December 13, 2008
and so on...
i want to convert it to 2008-12-13 00:00:00.000 or 2008-12-13 (its same for me)
so, in the sql server i can do it with this statement:
SELECT convert(datetime,myfiled, 107)
FROM ....
the question is , what is the equivalent statement to it within the SSIS 2008 ? (with derived column) Why not just do it in your source SQL as you described above? Or is the datasource not from SQL Server?
If not, take a look at: http://toddmcdermid.blogspot.com/2008/11/converting-strings-to-dates-in-derived.html#!/2008/11/converting-strings-to-dates-in-derived.html
HTH, Rob
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Monday, May 20, 2013 2:01 AM
Points: 8,
Visits: 37
|
|
the DS would be an XML file.... so i have to this within the ssis package :)
|
|
|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Friday, May 10, 2013 10:46 AM
Points: 156,
Visits: 512
|
|
avishain (1/21/2013) im developing an ssis package.
while im in the sql server , there is a field that contains a text string , for example:
December 13, 2008
and so on...
i want to convert it to 2008-12-13 00:00:00.000 or 2008-12-13 (its same for me)
so, in the sql server i can do it with this statement:
SELECT convert(datetime,myfiled, 107)
FROM ....
the question is , what is the equivalent statement to it within the SSIS 2008 ? (with derived column)
thank you
Here is expression you needed
(DT_STR,4,1252)YEAR((DT_DBDATE)"January 22, 2008") + "-" + (DT_STR,2,1252)MONTH((DT_DBDATE)"January 22, 2008") + "-" + (DT_STR,2,1252)DAY((DT_DBDATE)"January 22, 2008")
|
|
|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Friday, May 10, 2013 10:46 AM
Points: 156,
Visits: 512
|
|
Here is expression you needed
(DT_STR,4,1252)YEAR((DT_DBDATE)"January 22, 2008") + "-" + (DT_STR,2,1252)MONTH((DT_DBDATE)"January 22, 2008") + "-" + (DT_STR,2,1252)DAY((DT_DBDATE)"January 22, 2008")
|
|
|
|
|
Valued Member
      
Group: General Forum Members
Last Login: 2 days ago @ 12:51 PM
Points: 54,
Visits: 279
|
|
| type casting that column to dt_dbtimestamp should work
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Monday, May 20, 2013 2:01 AM
Points: 8,
Visits: 37
|
|
sqlbi.vvamsi (1/22/2013) type casting that column to dt_dbtimestamp should work
Works like a charm :)
thank you
|
|
|
|