I have to run a load every 6 AM in the morning, so just wanted those records that have been updated or created since this time i.e yesterday 6 AM and today 6 AM. I was thinking to use a logic to add 6 hours in YESTERDAY function to make it 6 am 7 subtract 18 hours from TODAY function to make it 6am, but evrytime i do this i receive an error sometime mall function query or sometime bind functions not allowed. Can anyone provide me the exact query for the same ? This is on high priority, i am using jitterbit for this.
You could do a SOQL query with System.Now() for current time and System.Now()-1 for yesterday's current time like below.
List<Case> c = [select id from case where createddate <: system.now() and createddate >: system.now()-1];
If the batch starts execution by 6.03 AM today, it will fetch all the records created between 6.03 AM today and 6.03 AM yesterday.
If the minute level accuracy is required we could do the following in apex batch class but not sure how to do that in informatica.
DateTime dt1 = Datetime.newInstanceGMT(System.now().year(),System.now().month() ,System.now().day(),System.now().hour(),0,0); DateTime dt2 = Datetime.newInstanceGMT(System.now().year(),System.now().month() ,System.now().day()-1,System.now().hour(),0,0); List<Case> c = [select id from case where createdDate <: dt1 and createdDate >: dt2];
Hope it helps.