I am writing an sql query from within the asp which goes as below:
strSQL = "SELECT created_date, due_date, "
strSQL = strSQL & DateDiff("y",created_date,due_date)
strSQL = strSQL & " as leadtime FROM JBSPEC WHERE created_date Between '2003-11-01' And '2003-11-30'"
I can get the records from the created_date and due_date column, but the leadtime column(which is the date difference between due_date and created_date) always give the value 0. Is is something wrong with my query? Appreciate if anybody could help me with this problem.