No Results when selecting 'Only show results within specified time'

Version 1
    This document was generated from CDN thread

    Created by: DAVID CHUMBLEY on 30-10-2013 11:09:53 AM
    I have a custom report that works fine if I use relative dates or specified dates.  When I select 'only show results that are within a specific time period' option though the report returns no records.  Comparing the SQL for each report query there are slight differences in the format:

    Working:
    from Call_Type_Half_Hour cthh
           inner join demo_awdb.dbo.Call_Type ct on ct.CallTypeID = cthh.CallTypeID where (DATEPART(dw, Convert(DateTime, Convert(char(10), cthh.DateTime, 101))) in(2,3,4,5,6,7,1) and Convert(DateTime, Convert(char(10), cthh.DateTime, 101)) between convert(DATETIME,'2013-10-01 00:00:00',21) and convert(DATETIME,'2013-10-30 23:59:59',21) and convert(, Convert(DateTime, Convert(char(10), cthh.DateTime, 101)), 108) between '00:00:00' and '23:59:59') and (cthh.CallTypeID IN (5013))    

    Not Working:
    from Call_Type_Half_Hour cthh
           inner join demo_awdb.dbo.Call_Type ct on ct.CallTypeID = cthh.CallTypeID where cthh.CallTypeID IN (5013) and (DATEPART(dw, Convert(DateTime, Convert(char(10), cthh.DateTime, 101))) in(2,3,4,5,6,7,1) and Convert(DateTime, Convert(char(10), cthh.DateTime, 101)) between convert(DATETIME,'2013-10-01 00:00:00',21) and convert(DATETIME,'2013-10-30 23:59:59',21) and convert(, Convert(DateTime, Convert(char(10), cthh.DateTime, 101)), 108) between '08:00:00' and '19:59:59')   

    Any ideas what could be my issue? 

    Thanks

    Subject: RE: No Results when selecting 'Only show results within specified time'
    Replied by: Edwin Andrews on 04-11-2013 08:22:21 AM
    /*
    I was getting a parse error at the comma located directly after the open parenthesis.... "(," for both examples.

    When I changed it to specify a data type,  "(varchar," it parsed, and ran, but resulted in the following logic error.

    The conversion of ONLY the first 10 characters of the date time value, as specified,  truncates the time values,
    and the subsequent reconversion to dateTime results in a time value of 00:00:00.

    The result is that in the second failing case it is searching for results BETWEEN the time values of "00:00:00" and "00:00:00" ...empty..
    ...I think.

    Demonstration...:
    */
    select
    convert(DATETIME,'2013-10-30 19:59:59',21)
    ,convert(DATETIME,'2013-10-01 08:00:00',21)
    ,convert(varchar,Convert(DateTime,Convert(char(10),'2013-10-30 19:59:59', 101)), 108)
    ,convert(varchar,Convert(DateTime,Convert(char(10),'2013-10-01 08:00:00', 101)), 108)
    ,convert(varchar,Convert(DateTime,Convert(char(10),'2013-10-01 00:00:00', 101)), 108)
    ,convert(varchar,Convert(DateTime,Convert(char(10),'2013-10-30 23:59:59', 101)), 108)

    /*
    Because these are generated by CUIC/CUIS at run time, I'm not sure what a solution would be.
    TAC?
    */