
use northwind
go

select * from orders
go

sp_helpindex 'orders'
go

select orderid, customerid, orderdate from orders where orderdate = '1997-05-30'

select orderid, customerid, orderdate
from orders
where orderdate = convert(varchar(8), 
                   dateadd(yy, -10, getdate()-1), 112)
go

select orderid, orderdate
from orders
where  convert(varchar(8), 
                   dateadd(yy, 10, orderdate), 112) = 
       convert(varchar(8),getdate()-1, 112)
go

select *
from orders
where  convert(varchar(8), 
                   dateadd(yy, 10, orderdate), 112) = 
       convert(varchar(8),getdate()-1, 112)
go

select orderid, orderdate
from orders
where dateadd(yy, 10, orderdate) < '2007'
go

select *
from orders
where dateadd(yy, 10, orderdate) < '2007'
go
