Question: I have a quick question regarding SSIS. I am developing a package that performs a Data Flow task from an Excel Source into OLE DB Connection. The columns in the database should allow nulls. However there is a problem in that when I enter bad data into the numeric columns in the excel spreadsheet, it will not cause the Data Flow task to fail as I would like it to. I tried to remedy this by explicitly trying to convert any numeric columns in the Derived Column step, however the same thing occurs-- if I enter abc into the Excel numeric column, if just turns out as NULL in the db after the package runs. I do want to allow for NULLS, but I'd like the package to fail if the data is corrupt. 

Any advice would be appreciated :)

Answer: 
This works in Oracle - may give you some ideas and hopefully helps:

```
-- Last weeks of last two months -- 
SELECT mydate
  , TRUNC(mydate, 'iw') wk_starts
  , TRUNC(mydate, 'iw') + 7 - 1/86400 wk_ends
  , TO_NUMBER (TO_CHAR (mydate, 'IW')) ISO_wk#  
 FROM
  ( -- Last week = Last day of the year (hardcoded) - 1 week --
   SELECT(CASE WHEN start_date = To_Date('12/31/2012', 'mm/dd/yyyy') THEN start_date-7 ELSE start_date END) mydate 
     FROM
     ( -- Last 2 months --
      SELECT Add_Months(Last_Day(Trunc(SYSDATE)), - LEVEL) start_date
        FROM dual
     CONNECT BY LEVEL <= 2
    )
 )
/

```
This is somewhat dependent on your sql server. This example is similar to Oracle. Each server has its own functions, like SYSDATE and NOW.

For example.

```
SELECT * from blah WHERE TO_CHAR(TRUNC(data), MM/DD/YYYY) < '01/14/2013'

```