Tuesday, August 19, 2008

Interactive Reporting: Is My_Billing_Date a data type of Date or is it of String?

Is My_Billing_Date of data type Date or is it of type String?

 

You can avoid the ambiguities encountered with date formats by creating a new date object instead of using a string.  To create a date object, use: New Date(yr, mo, da) Where yr is the 4 digit year, mo is the month (zero based, so January is 0), and da is the day of the month.

 

For your computed column, you could say:

MonthsBetween (YTD_Billing_Date, new Date(2002, 6, 1));

 

This formula would calcuate the number of months between YTD_Billing_Date and July 1, 2002.