- Home
- Technical Library
- Boards
- Cookbook
- Code Share
- Blogs
- Partners
-
More
-
Services
- Training & Certification
- Support
-
Galleries
- Force.com Sites Gallery
- Chatter Challenge Entries
-
Other Web Sites
- Salesforce.com
- Database.com
- AppExchange
- CRM Community
-
Discussions
- Announcements
- General Development
- Schema Development
- New to Cloud Development
- Apex Code Development
- Visualforce Development
- Formulas & Validation Rules Discussion
- Security
- Mobile
- Force.com Sites
- Chatter Development
- Java Development
- .NET Development
- Perl, PHP, Python & Ruby Development
- Adobe Flash Builder for Force.com
- Desktop Integration
- REST API Integration
- Streaming API
- Visual Workflow
- Apple, Mac and OS X
- VB and Office Development
- Excel Connector
- AJAX Toolkit & S-controls
- Force.com Builder & Native Apps
- AppExchange Directory & Packaging
- Force.com Labs Projects
- Open Source
- Site.com
- Jobs Board - Administrators
- Jobs Board - Developers
- Force.com Discussion Boards
- :
- Developer Boards for Force.com and Database.com
- :
- Apex Code Development
- :
- Date Issue (Adding two dates)
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
Date Issue (Adding two dates)
[ Edited ]- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
01-06-2012 10:48 PM - last edited on 01-25-2012 07:48 AM
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
<a href="http://securecashadvanceonline.com/"> loans personal </a>
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
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.
Thanks
Re: Date Issue (Adding two dates)
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
01-06-2012 11:34 PM
Try these changes
Date BookingDate=opp1.Date_Opened__c.addDays(opp1.Average_Sales_Cycle__c);
If a reply to a post answers your question or resolves your problem, please mark it as the solution to the post so that others may benefit.
Software Engineer @ Sabre Technologies (PVT) Ltd
Salesforce World Blog | LinkedIn | Twitter | My Ideas

