• Artemiy
  • NEWBIE
  • 0 Points
  • Member since 2008

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 0
    Replies
I would like to select all objects (e.g. opportunities or other)  with CloseDate within next 7 days. I am trying to use the following code:

Code:
date MyDate = system.today().adddays(7);

Opportunity[] opps = [select name from Opportunity where CloseDate < MyDate];

 but I am getting "Compile Error: unexpected token: MyDate at line..."

What expression should I use for my query?

I am newbie in Apex development, so I hope somebody can help me.

I would like to know is there any way to send email with report details? If yes - how can I do that?

 Probably someone has this script already and can give me some advises. I'll appreciate any help in this question.