I am needing some help with a query that contains a date. I am collecting this date through a VF page with the help of a birthday fake contact field, my class is something like this: Controller:
public with sharing class MyCLass {
public Contact fakeCont { get; set; }
public String queryString { get; set; }
public MyCLass() {
fakeCont = new Contact();
}
public void doQuery(){
queryString = 'SELECT id, Name FROM SObject WHERE dateExample = ' + fakeCont.Birthdate ;
}
}
VF Page:
<apex:inputField styleClass="form-control" value="{!fakeCont.Birthdate}"/>
even that the field in contact is mark as date after selecting it displays something like 2014-11-02 00:00:00
it is not supposed to be displayed like: 2014-11-02 ? as this field is date and not datetime?
if I try to use something like
newDate = fakeCont.Birthdate.date();
I will get an error