+ Start a Discussion
NBlasgenNBlasgen 

DateTime questions

SELECT Id FROM Lead WHERE LastModifiedDate = 2010-05-03 doesn't work of corse since it's looking for a DateTime.  But do I really need to do a search on 20010-05-03T00:00:00 to 2010-05-04T00:00;00.  When creating a Lead View, I can define a specific date and have everything work out behind the scene.  Just wondering if there is a better way then to define the range.

Best Answer chosen by Admin (Salesforce Developers) 
Mark SFMark SF

Try using the date functions. For example:

 

SELECT Id FROM Lead WHERE DAY_ONLY(LastModifiedDate) = 2010-05-03

 

See  Date Functions doc for variations and other functions.

All Answers

Mark SFMark SF

Try using the date functions. For example:

 

SELECT Id FROM Lead WHERE DAY_ONLY(LastModifiedDate) = 2010-05-03

 

See  Date Functions doc for variations and other functions.

This was selected as the best answer
NBlasgenNBlasgen

Hey, that's perfect.  Thanks.  I even used Salesforce Premier support and they didn't have that type of suggestion.