select * from TABLE where username=@cuser and convert(datetime,dateaccessed,105) BETWEEN convert(datetime,@frmdate,105) AND dateadd(day,1,convert(datetime,@todate,105))
dateaccessed->DATABASE FIELD HAVING VARCHAR DATATYPE CONTAINS DATA OF DATETIME FORMAT
@frmdate-> FROM DATE HAVING VARCHAR DATATYPE
@todate->TODATE HAVING VARCHAR DATATYPE
dateadd() FUNCTION ADD A DATE TO THE GIVEN DATE
dateaccessed->DATABASE FIELD HAVING VARCHAR DATATYPE CONTAINS DATA OF DATETIME FORMAT
@frmdate-> FROM DATE HAVING VARCHAR DATATYPE
@todate->TODATE HAVING VARCHAR DATATYPE
dateadd() FUNCTION ADD A DATE TO THE GIVEN DATE