+ Start a Discussion

Date Issue (Adding two dates)

Hi all,


I have two fields Average_Sales_Cycle__c and Booking_Date__c.

Average_Sales_Cycle__c        Number(18, 0)

Booking_Date__c                     Date


I want to add both these fields and get the added value as a date. I am querying these two fields in a btach apex and trying to add both like below.


Date BookingDate=opp1.Date_Opened__c+opp1.Average_Sales_Cycle__c


but getting an error "Date arithmetic expressions must use Integer or Long arguments at line 85 column 40".


How can I achieve this and I also want to compare the month of BookingDate against 1 to 12.


Please let me know how this can be achieved.






Best Answer chosen by Admin (Salesforce Developers) 

Got the issue now..Below format resolved my issue.