function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
fiona gentryfiona gentry 

How To Amend Below SOQL to get All records for today After 6am

Hi gurus,

Is there a way i can customize below soql to  include all records after 6am from Today?
 
select Case__c, Level_1__c, Level_2__c,Level_3__c  FROM Case_Type__c  where createddate = today group by Case__c,Level_1__c, Level_2__c,Level_3__c


I need SOQL only ,Apex class wont work,please let me know 

Regards,
Fiona
AnudeepAnudeep (Salesforce Developers) 

You can use Date Formats and Date Literals together with Date Functions directly in the SOQL query:

DATETIMEVALUE() is a method for converting text into a Date/Time value corresponding to a particular date for example March 17, 2015 at 5 PM GMT.

DATETIMEVALUE("2015-03-17 17:00:00")

Let me know if this helps, if it does, please close the query by marking it as solved. It may help others in the community. Thank You!