Hello Naresh,
the format of "lastloggedin" is the same as you described above for "creationdate"? Did you check if all values for both columns have a valid value in the specified format?
One problem (which do not cause the error) are the date comparisons in your outer where clause. The to_char function produces a value in format 'YYYY-MM-DD'. Comparing it to values in format 'MM-DD-YYYY' does make much sense. Also the character based comparsion does not make sense for the date values. You should remove the to_char function in the where clause and comparte date values, e.g. to_date("creationdate", 'MM-DD-YYYY') BETWEEN to_date('04-12-2015','MM-DD-YYYY') AND to_date('04-19-2015','MM-DD-YYYY').
Regards,
Florian