You need to sign in to do that
Don't have an account?
Mitch Morrison
Apex compare Event EndDateTime to Today
Trying to compare an Events EndDateTime to today's date. Obviously, I need to convert EndDateTime to something that can be compared. I tried:
DateTime dt = Ev.EndDateTime();
Date EndDate = date.newInstance(dt.year(), dt.month(), dt.day());
And got this error: Method does not exist or incorrect signature: void EndDateTime() from the type Event
I want to get the difference between the Event date and today's date (so subtraction is needed). Thanks for any help!
DateTime dt = Ev.EndDateTime();
Date EndDate = date.newInstance(dt.year(), dt.month(), dt.day());
And got this error: Method does not exist or incorrect signature: void EndDateTime() from the type Event
I want to get the difference between the Event date and today's date (so subtraction is needed). Thanks for any help!
Try this :
I think you are refering to the Events EndDateTime field.
Thanks
Anil.B
Try changing your code as below :
Event e=[Select EndDateTime From Event where whatid=:tsk.whatid and what.type = 'Account' and EndDateTime <=:system.now()];
I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.
Thanks,
Ajay Dubedi