DATEDIFF(d,date1,date2)

qui c'è un po' di sql se ti interessa
http://www.morpheusweb.it/html/manua...l_funzioni.asp