# Tag Info

### Error: Incorrect parameter type for function 'MOD()'. Expected Number, received Date/Time

The issue is MOD() function expects a number, but you're providing a date/time value. You can try this formula: DATE( YEAR(CreatedDate), MONTH(CreatedDate), DAY(CreatedDate) + ...
• 2,148

### Error: Incorrect parameter type for function 'MOD()'. Expected Number, received Date/Time

MOD(CreatedDate, 7) doesn't work, because you can't divide a date by a number. However, just choose a date that is a Sunday, and subtract that from the CreatedDate. MOD(CreatedDate - DATE(1970, 1, 4), ...
• 497k

### Error: Incorrect parameter type for function 'MOD()'. Expected Number, received Date/Time

try something like this public static Date calculateDueDate(Date startDate, Integer daysToRespond) { Integer daysToAdd = 0; while(daysToAdd < daysToRespond) { startDate = startDate.addDays(1); ...
• 43
1 vote
Accepted

### Help editing formula field

To ensure that the Price_Book_Name__c field populates with only one of the names from either Price_Book__c or Product_Interested_In__c, you can use a formula that checks if one field is filled and ...
• 2,148

### How to make a formula with correct difference between dates in months?

You can use a more precise method by calculating the number of days and then dividing by the average number of days per month. ROUND( ((YEAR(EndDate__c) - YEAR(EffectiveDate__c)) * 12 + ...
• 2,148

### Help with date formula

I would break down this into 2 separate use cases: When Start_date__c is less than today's date we need the field value to be rolled over by 1 year i.e. 12 months When Start_date__c is greater than ...
• 2,091
1 vote

### Help with date formula

Below is a Formula you can use: IF( TODAY() > DATE(YEAR(TODAY()), MONTH(Contract_Start_Date__c), DAY(Contract_Start_Date__c)), DATE(YEAR(TODAY()) + 1, MONTH(Contract_Start_Date__c), DAY(...
• 2,148
1 vote

### How to calculate the number of days until close on a summary-level formula column in a report?

I believe you should be using the API name of the field, which is CloseDate if the main object of your report is the opportunity. You can read this article too, on Salesforce Ben, about Summary ...
• 13.9k