• the query needs to be dynamic so I don't want to hard code anything. The data will be pulled into month end reporting.

    The idea of it is to return all rows which are upto the last working day of the previous month.

    I have solved the issue, In my where clasue I had a range of dtae which was not wrapped, so wrapping that stament made work.

    (

    (NOMINAL_CODE between '200000' and '209999')

    or

    (NOMINAL_CODE between '210000' and '210799')

    )