+ Start a Discussion
Beatriz MinguezBeatriz Minguez 

How to call a Procedure with Dates

How can I call the procedure CheckDates with two dates? VerifyDate.CheckDates('310/01/2015', '30/02/2016') is giving me an error as they are treating the parameters as two strings.. 

public class VerifyDate {
    //method to handle potential checks against two dates
    public static Date CheckDates(Date date1, Date date2) {
        //if date2 is within the next 30 days of date1, use date2.  Otherwise use the end of the month
        if(DateWithin30Days(date1,date2)) {
            return date2;
        } else {
            return SetEndOfMonthDate(date1);

Can anyone help me?