i have some records on my mysql db. my table name is 'facts' and the particular field name is 'factdate'. In the factdate field has some records of dates. They are like, 1947-08-15 or 1235-00-00 or 0000-04-14 or 1984-00-17 or 0000-00-10 or 0000-07-00 or sometime its null. So, how to i retrieve records on the basis of user select any one of the method like year month day only or year only or month only or day only or year and month only or etc. so, however like anyone. So, i think the select query used by the if else condition, so how to apply this. Please give a sample query for this problem.
Note: the factdate field data types is ' varchar '.