I am using sql 2005 on a windows 2003 server. I have a view created that will extract accounts receivable information from the database. I am trying to look at the invoice dates for last year and put a yes in a ytd column if the invoice date is equal to or before last years year-to-date. (The ytd column is not part of the database). For example, if todays date is 03/17/08, the records that are from 01/01/07 to 03/17/07 will have a yes in the ytd column, and all of this years data will have a yes. Also, I need to calculate last years year-to-date, accounting for this year being a leap year.
Thanks in advance,
JoMar
Start Free Trial