ZMike
Posting Yak Master
110 Posts |
Posted - 2013-03-04 : 16:21:03
|
Good Afternoon Everyone,I'm trying to figure out the IF Statement for connections strings. Basically if GETDATE() = Monday I believe I'd use this RIGHT("0" + (DT_STR,4,1252) DATEPART("DW", GETDATE() ),2) =02THEN"/data/TransferData" +RIGHT("0" + (DT_STR,4,1252) DATEPART("M", GETDATE()),2)+RIGHT("0" + (DT_STR,4,1252) DATEPART("D",DATEADD("D", -3, GETDATE())) ,2)+(DT_WSTR, 4) YEAR( GETDATE() ) + "-"+RIGHT("0" + (DT_STR,4,1252) DATEPART("M",GETDATE()),2) +RIGHT("0" + (DT_STR,4,1252) DATEPART("D",GETDATE()),2) +(DT_WSTR, 4) YEAR( GETDATE() ) +".csv"ELSE"/data/TransferData" +RIGHT("0" + (DT_STR,4,1252) DATEPART("M", GETDATE()),2)+RIGHT("0" + (DT_STR,4,1252) DATEPART("D",DATEADD("D", -1, GETDATE())) ,2)+(DT_WSTR, 4) YEAR( GETDATE() ) + "-"+RIGHT("0" + (DT_STR,4,1252) DATEPART("M",GETDATE()),2) +RIGHT("0" + (DT_STR,4,1252) DATEPART("D",GETDATE()),2) +(DT_WSTR, 4) YEAR( GETDATE() ) +".csv"Can anyone tell me how to achieve this ? |
|