Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2012 Forums
 Transact-SQL (2012)
 no visit / visit member total on 3 month

Author  Topic 

usafelix
Posting Yak Master

165 Posts

Posted - 2015-02-11 : 23:44:59
Anyone can help edit this query ? This query not allow to show duplicate member id.
-----------------------------------------
select member_id,visit_member_total, no_visit_member_total,shop_code
case when trx_date>=dateadd(month, -3, getdate())
then visit_member_total+1
else
no_visit_member_total+1
end as result
from header

gbritton
Master Smack Fu Yak Hacker

2780 Posts

Posted - 2015-02-12 : 06:57:32
Duplicate post
Go to Top of Page
   

- Advertisement -