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

Re: Query using UDF field to link to Activity

$
0
0

Hi Manish

 

Thank you - Yes I understand problem now.

Because I was trying to re-use old UDF field for new purpose some old data of non-numeric type was preventing query from executing. I would have to delete old data.

 

So now instead I have made new UDF : CRD1.U_ExtraVisit1 also alphanumeric and below query is executing OK.

 

But the query return result only if there exist an entry in U_ExtraVisit1.

I want query to return all records where there is an entry in CRD1.U_NxtVisitDue <600 days...If there is entry in U_ExtraVisit1 this should appear in the record.. if no entry in this field record should still appear in result with blank field in the column.

 

Can you advise?

 

SELECT  T0.[CardName], T1.Address, T1.U_Territory, T1.U_NxtVisitDue AS 'Nxt Visit Due (Approved)', T1.U_LastVisit AS 'Last Visit (Approved)', T1.U_ExtraVisit1 AS 'Extra Visit 1', T2.Details

FROM  OCRD T0

LEFT JOIN CRD1 T1 on T1.CardCode=T0.CardCode JOIN OCLG T2 on T2.ClgCode = T1.U_NxtVisitReason

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

 

Regards,

Karen


Viewing all articles
Browse latest Browse all 8594

Trending Articles



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