I need help in designing a SOQL QUERY.
Scenario is: Every day 10 pm my batch class will run (Its a scheduled one) and in the batch class i have a query to fetch all the orders which are stuck at 'Ready To Submit' status.Now i need to add 2 more condition to my SOQL:
1- I need only today's orders 2- Which are created before 7pm.
The format of CreatedDate in our salesforce org looke like: 2023-07-21T03:17:43.000+0000 (yyyy-MM-dd'T'HH:mm:ss.SSS)
yyyy is the four-digit year MM is the two-digit month (01-12) dd is the two-digit day (01-31) HH is the two-digit hour (00-23) mm is the two-digit minute (00-59) ss is the two-digit seconds (00-59) SSS is the three-digit milliseconds (000-999)
I have formed the query like below- but i am getting an error - Unknown error parsing query.
SELECT Id,OrderStatus__c ,CreatedDate from Order where
OrderStatus__c = 'Ready To Submit' AND
CreatedDate = TODAY AND
AND TIMEVALUE(CreatedDate) < 19:00:00.000+0000
I am getting Unknown error parsing query. Please advise me, on the my SOQL query.