date issues in SSIS

  • SELECT

    *

    FROM Table1

    WHERE

    mydate =convert(varchar, getdate(), 111)

    I am running this query in SSIS.I have data with todays date but I cant return the data with the above sql.It runs good in sql analyser but does not return data in SSIS.Appreciate reponses.

    sqlserver version 2000

    Thanks

  • How are you testing the output in SSIS?

    For starters Select top 1 (any 1 column) record instead and save it in a variable and see if the variable displays the value.

  • What is the data type of the output column in SSIS? When I look at your query, it should be DT_STR or DT_WSTR with a length of at least 10 characters.

    Do you get any errors?

    ps: select * is usually a bad idea

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

  • It runs good in sql analyser but does not return data in SSIS

    It runs fine in SSIS also, It might me the datatype mismatch and also check on what others have suggested.. Check the Example below. Firstly create the Temp Table in Management studio or analyzer and then Insert the values.Secondly, Run the Select in SSMS/Analyzer or SSIS it will produce the same result set.. So, Check for the dataTypes and the Values in the column

    CREATE TABLE ##Test

    (

    ID INT,

    DataEntryDate DateTime

    )

    INSERT INTO ##Test (ID,DataEntryDate) VALUES

    (1,'2010-06-09 00:00:00.00'),

    (2,'2010-06-08 00:00:00.00'),

    (3,'2010-06-07 00:00:00.00')

    SELECT ID,DataEntryDate from ##Test

    WHERE DataEntryDate = convert(varchar, getdate(), 111)

    DROP TABLE ##Test

  • I was able to run this query and it worked. To view the value of the variable use the Quick Watch window. This appears when the debugger is stopped on a breakpoint. If you set a breakpoint on a step, you should be able to enter variables into the Watch window when the breakpoint is hit. Select the first empty row in the Watch window and enter the variable name. VS 2005 doesnt have intellisense so you need to type the variable name here.

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply