Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 9656

Re: Assistance with SQL query

$
0
0

Hi

you cant write "where" before the inner join and you have the "where" twice

 

try this:

 

SELECT T0.[CardName], T1.Address, T1.U_Territory, T1.U_NxtVisitDue, MAX(T2.Recontact) AS 'Last Visit Date'

FROM  OCRD T0 INNER JOIN CRD1 T1 on T1.CardCode=T0.CardCode
INNER JOIN OCLG T2 on T2.CardCode=T0.CardCode

WHERE DateDiff(dd,GetDate(), T1.U_NxtVisitDue) <0

and  T2.CntctType='Visit to Customer'

FOR BROWSE

 

shachar

 


Viewing all articles
Browse latest Browse all 9656

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>