Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
ashuthinks
Starting Member
8 Posts |
Posted - 2011-09-19 : 04:34:56
|
| I have one SSIS which takes data from .csv file and insert into sql tablenow my file name isFlat file properties and expression for connection string is :@[User::Directory] + @[User::Filename]+" "+(DT_STR,4,1252)DATEPART( "yyyy" , getdate() ) +"-"+ RIGHT("0" + (DT_STR,4,1252)DATEPART( "mm" , getdate() ), 2) +"-"+ RIGHT("0" + (DT_STR,4,1252)DATEPART( "dd" , DATEADD("day", -1, GETDATE()) ), 2) +".csv"which gives me filename like : C:\mytempdata\ACCTMVCHNG_CSV 2011-09-18.csvthis is yesterdays filenamebut when i run this package on monday the file present is for friday only name will be ACCTMVCHNG_CSV 2011-09-16.csvso i want to use if else into this expressionlike if todays day is monday then take fridays file i mean create file path for fridaylike this : C:\mytempdata\ACCTMVCHNG_CSV 2011-09-16.csvor else take as it is yesterdays like what i'm doing in above expression... |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2011-09-19 : 05:12:54
|
| you need to use conditional operator like below(condition)?(true part):(false part)------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
|
|
|
|
|