I need the ability to compare 2 dates and be able to specify if the results are returned in months or days. Is there a built-in XQuery function that can perform this type of arithmetic. For example: 10-31-2003 - 10-01-2003 = 30 days 10-31-2003 - 8-01-2003 = 2 months