Skip to main content
1 of 2

You candirectly query it like: List opportunities = [SELECT OwnerId, Amount, Probability FROM OPPORTUNITY where Amount > 0 and LastModifiedDate < LAST_N_DAYS:7];

No need to declare variable and its value fisrt,