I have the following query:
select
a.MyDate,
Sunday = dateadd(dd,((da tediff(dd,'1753 0107',a.MyDate)/7)*7)+7,'175301 07')
from
( -- Test Data
select MyDate = convert(datetim e,'20100930')
) a
and what I'd like to do is instead of offering a datetime, I have a SQL field that I need to pull from with the date. Can anyone offer me a suggestion on how to do that?
What I see changing is the
select MyDate = [exceptions].exceptiondate.
I tried that though and I get an error:
The column prefix 'exceptions' does not match with a table name or alias name used in the query.
Thank you,
Doug
select
a.MyDate,
Sunday = dateadd(dd,((da tediff(dd,'1753 0107',a.MyDate)/7)*7)+7,'175301 07')
from
( -- Test Data
select MyDate = convert(datetim e,'20100930')
) a
and what I'd like to do is instead of offering a datetime, I have a SQL field that I need to pull from with the date. Can anyone offer me a suggestion on how to do that?
What I see changing is the
select MyDate = [exceptions].exceptiondate.
I tried that though and I get an error:
The column prefix 'exceptions' does not match with a table name or alias name used in the query.
Thank you,
Doug
Comment