Good morning,
I'm attempting to create a 90 day bucket in SQL where it begins on the second day of the month and ends on the first day of the next month. So far I have the following code, which I transferred from Access and then adjusted for SQL Server,
WHERE ((((vwMainWithInvestor.NextPaymentDueDate) Between DateAdd(month,-3,convert(varchar,GetDate(),'mm/''02''/yyyy')) And DateAdd(day,-1,DateAdd(Month,-2,convert(varchar,getDate(),'mm/''01''/yyyy'))))))
I'm receiving the following error "Argument data type varchar is invalid for argument 3 of convert function" at the MM/01/yyyy part. When I change the convert from varchar to datetime, I still get the same error. The NextPaymentDueDate is a datetime field.
Thanks in advance for your assistance.
Sydney
I'm attempting to create a 90 day bucket in SQL where it begins on the second day of the month and ends on the first day of the next month. So far I have the following code, which I transferred from Access and then adjusted for SQL Server,
WHERE ((((vwMainWithInvestor.NextPaymentDueDate) Between DateAdd(month,-3,convert(varchar,GetDate(),'mm/''02''/yyyy')) And DateAdd(day,-1,DateAdd(Month,-2,convert(varchar,getDate(),'mm/''01''/yyyy'))))))
I'm receiving the following error "Argument data type varchar is invalid for argument 3 of convert function" at the MM/01/yyyy part. When I change the convert from varchar to datetime, I still get the same error. The NextPaymentDueDate is a datetime field.
Thanks in advance for your assistance.
Sydney