Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase ««12

convert datatype DT_STRING to DT_DBDATE in ssis Expand / Collapse
Author
Message
Posted Thursday, March 19, 2009 1:38 PM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Friday, August 28, 2009 9:53 AM
Points: 23, Visits: 46
I guess, I didn't read your initial post correctly. If you want null when the date value is '0' use NULL(DT_DBDATE).
Peter
Post #679854
Posted Monday, April 20, 2009 6:24 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Tuesday, November 17, 2009 4:33 AM
Points: 1, Visits: 24
Hi,
Since the expression is cast to DB_TIMESTAMP, would it not fail for invalid date string?
eg. If the input string is 20090230 (which is an invalid date), how do you handle this in the expression.
Post #700543
Posted Monday, April 20, 2009 8:03 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Friday, August 28, 2009 9:53 AM
Points: 23, Visits: 46
This example shows how to check for valid date and replace default date for invalid date.
(DT_BOOL)(DT_DATE)IssueDate_C ? IssueDate_C : "01/01/1900"
Post #700635
Posted Wednesday, June 12, 2013 12:06 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Friday, December 5, 2014 5:13 PM
Points: 4, Visits: 17
SELECT CONVERT(VARCHAR(10),GETDATE(),121);
Output: 2013-06-12

Example:-
SELECT CONVERT(VARCHAR(10),ContractEndDate,121)
From TestDataTable_Archive;


You can Play with the different format values like 111 etc.

SELECT CONVERT(VARCHAR(10),GETDATE(),111);
Output: 2013/09/30
Post #1462769
« Prev Topic | Next Topic »

Add to briefcase ««12

Permissions Expand / Collapse