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

Variable Expression Expand / Collapse
Author
Message
Posted Thursday, December 12, 2013 3:55 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Tuesday, March 25, 2014 6:07 AM
Points: 8, Visits: 45
When i used the below Expression in SSIS package variable.

DATEADD("D",-(DAY(DATEADD("M",1,GETDATE()))),DATEADD("M",1,GETDATE()))

result is

12/31/2013 4:23:13 PM

i am looking for a result in below format.

2013-12-31 00:00:00.000

Any help...
Post #1522218
Posted Thursday, December 12, 2013 4:09 AM
Mr or Mrs. 500

Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500

Group: General Forum Members
Last Login: Today @ 8:36 AM
Points: 588, Visits: 1,157
This'll do it:

(DT_DBTIMESTAMP) (DT_DBDATE) DATEADD("D",-(DAY(DATEADD("M",1,GETDATE()))),DATEADD("M",1,GETDATE()))

To clarify, I'm converting the DATETIME into DATE to strip the time and then re-converting back to DATETIME.






I'm on LinkedIn
Post #1522222
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse