Okay;
If I swap the <= & >= and remove the single quotes I get the date plus the days in dateadd
If I leave the <= & >= as is I get no results.
No results, no errors:
SELECT ARN_InvHistoryHeader.invoicenumber, ARN_InvHistoryHeader.invoicedate FROM ARN_InvHistoryHeader WHERE ARN_InvHistoryHeader.InvoiceDate <= '1/30/2007' AND ARN_InvHistoryHeader.InvoiceDate >= DateAdd(d,45,'1/30/2007') order by invoicedate;
Results of 1/30 + 45 days
SELECT ARN_InvHistoryHeader.invoicenumber, ARN_InvHistoryHeader.invoicedate FROM ARN_InvHistoryHeader WHERE ARN_InvHistoryHeader.InvoiceDate >= '1/30/2007' AND ARN_InvHistoryHeader.InvoiceDate <= DateAdd(d,45,'1/30/2007') order by invoicedate
I had to add a few things to sort what the results where....