You need to sign in to do that
Don't have an account?
New_Developer
help with query
I need a query which returns the list of records whose lastmodifieddate falls in now() minus 2 mins
List<Object> reclist = [Select id from Object where LastModifiedDate =???];
Thanks
I'd do something like:
List<Object> recList = [Select Id from Object where Object.LastModifiedDate = System.now().addMinutes(-2) ];
Regards,
Anup
All Answers
I'd do something like:
List<Object> recList = [Select Id from Object where Object.LastModifiedDate = System.now().addMinutes(-2) ];
Regards,
Anup
would this be the same logic for hours? days?
if it's hours, then replace addMinutes() with addDays(), and if it's years, then addMinutes() with addYears(). Put addMonths() if you want months.
If this resolves your query, please mark it as solved.
Thanks,
Anup
Is your query resolved?
Regards,
Anup
Yes, Thank You