OLEDB SOURCE QUERY THROUGH EXPRESSION

  • Hi

    I am putting the below query in a OLEDB SOURCE through a variable (it is a select statement with a where clause from one date to another).

    I am getting through this expression. Can you have a check on it please.I dont know whats is wrong with this expression

    "select TestRecordtype, request_id from department

    where LOAD_TMSTP between

    (select max(END_TMSTP) LOG) and

    (TO_DATE("+RIGHT("0" + (DT_STR,4,1252)DATEPART( "dd" , @[System::StartTime] ), 2) + "-"

    +RIGHT("0" + (DT_STR,4,1252)DATEPART( "mm" , @[System::StartTime] ), 2) + "-"

    +RIGHT("0" + (DT_STR,4,1252)DATEPART( "yy" , @[System::StartTime] ), 2) + " "

    +RIGHT("0" + (DT_STR,4,1252)DATEPART( "hh" , @[System::StartTime] ), 2) + "."

    +RIGHT("0" + (DT_STR,4,1252)DATEPART( "mi" , @[System::StartTime] ), 2) + "."

    +RIGHT("0" + (DT_STR,4,1252)DATEPART( "ss" , @[System::StartTime] ), 2) +",'DD-MM-YY HH24.MI.SS')) "

    Thanks

  • I think the problem is in this line:

    (select max(END_TMSTP) LOG)

    There is no FROM clause, is LOG an alias for MAX(END_TMSTMP) or is the query supposed to be:

    Select MAX(END_TMSTP) FROM LOG

Viewing 2 posts - 1 through 1 (of 1 total)

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