locked
datetime null RRS feed

  • Question

  • HI

    in my ssis...i want to compare load_date to create date..but my 1st run my load date is empty

    so that i used isnull function in ssis

    ISNULL(load_date) ? GETDATE() : load_date

    this query i got success

    but i need
    ISNULL(load_date) ? 01/01/1111 : load_date

    so i compare any previous date to my today load_date how to write this condition in ssis
    Wednesday, November 30, 2011 5:27 AM

Answers

  • You need to cast the date according to “load_date field” datatype(Date or datetime) shown bellow

     

    ISNULL(load_date) ? (DT_DBTIMESTAMP)"01/01/1111" : load_date 

     

    • Proposed as answer by SSISJoostMVP Wednesday, November 30, 2011 6:41 AM
    • Marked as answer by sql.anandan Friday, December 2, 2011 11:39 AM
    Wednesday, November 30, 2011 6:08 AM

All replies

  • You need to cast the date according to “load_date field” datatype(Date or datetime) shown bellow

     

    ISNULL(load_date) ? (DT_DBTIMESTAMP)"01/01/1111" : load_date 

     

    • Proposed as answer by SSISJoostMVP Wednesday, November 30, 2011 6:41 AM
    • Marked as answer by sql.anandan Friday, December 2, 2011 11:39 AM
    Wednesday, November 30, 2011 6:08 AM
  • I agree with Kiran although it's probably better to use the ISO format YYYY-MM-DD. Example: 1753-01-01 or 2011-11-30

     


    Please mark the post as answered if it answers your question | My SSIS Blog: http://microsoft-ssis.blogspot.com
    • Edited by SSISJoostMVP Wednesday, November 30, 2011 6:50 AM
    Wednesday, November 30, 2011 6:49 AM