Home Forums Data Warehousing Integration Services Flat File Source: prevent records from loading with a valid date but in the wrong format RE: Flat File Source: prevent records from loading with a valid date but in the wrong format

  • Phil, Thanks but no thanks 🙂

    I hate regex. The regex would need to treat it as a string (either explicitly or cast in a derived column) and then apply rules such as

    1st digit of month can only be 0 or 1. If it is 0 then the second digit can only be 1 thru 9. If the first digit is a 1 then the 2nd digit can only be a 0,1 or 2.

    The 1st digit of the day can only be 0,1,2,3. If it is 0 then the second can only be 1-9 if it is 1 or 2 then the second can be 0-9 unless the month is 02 in which case it is only 0-8 unless the year is divisible by 4 but not 100 in which case is 0-9. If the first digit is 3 then the second can only be 0 or 1 unless the month is 02 in which case it is invalid!