You need to sign in to do that
Don't have an account?
Cyclebiff
How to pass integer to Apex SOQL query using date formula??
APEX Gurus,
I'm trying to pass a query using APEX/SOQL, how do I perform a "break" for a date formula? I've tried using double colons, etc, nothing works.. HELP!!
Query:
integer numOfDays = 7;
Attachment[] lastAttachment = [select Body, Id, Name, ContentType from Attachment where Parentid=:a.Id and CreatedDate = LAST_N_DAYS:numOfDays and CreatedByID !=:a.OwnerID order by CreatedDate DESC];
Error: Compile Error: expecting a number, found ':' at line 20 column 141
See this post to get around your problem :
http://forums.sforce.com/sforce/board/message?board.id=apex&message.id=12850