cancel
Showing results for 
Search instead for 
Did you mean: 

Need Selection and Outstanding Balance in this query.

former_member261836
Participant
0 Kudos

HI everyone,

Thanks for your quick response. Actually I m unable to fetch all details while I am giving selection for T0.[GroupName] and which date need to take for outstanding balance day wise.

SELECT distinct T0.[CardCode], T0.[CardName] as 'Custmer Name',  T3.[Name] as 'State',T2.[GroupName] , T0.[Balance] as 'Balance'   FROM OCRD T0  left JOIN CRD1 T1 ON T0.[CardCode] = T1.[CardCode] left JOIN OCRG T2 ON T0.[GroupCode] = T2.[GroupCode] left JOIN OCST T3 ON T1.[State] = T3.[Code] and T3.Country = T1.country  WHERE  T0.CardType = 'C'

Thanks

Vedanth

Accepted Solutions (0)

Answers (3)

Answers (3)

former_member261836
Participant
0 Kudos

Can anyone give the date Selection criteria for BP Customer Code account balance based on this Query.

SELECT distinct T0.[CardCode], T0.[CardName] as 'Custmer Name',  T3.[Name] as 'State',T2.[GroupName] , (Select  distinct T0.[Balance] as 'Balance', t4.Refdate from ocrd t0 inner join jdt1 on T0.[CardCode] = t4.[RefDate]) FROM OCRD T0  left JOIN CRD1 T1 ON T0.[CardCode] = T1.[CardCode] left JOIN OCRG T2 ON T0.[GroupCode] = T2.[GroupCode] left JOIN OCST T3 ON T1.[State] = T3.[Code] and T3.Country = T1.country  WHERE  T0.CardType = 'C' and T2.[GroupName] between [%0] and [%1] group by T0.[CardCode], T0.[CardName],  T3.[Name],T2.[GroupName], T0.[Balance], t4.Refdate

thanks you

vedanth m

former_member261836
Participant
0 Kudos

Thanks  for your reply Nagarajan, actually I need one more selection date to this query that should be from JDT1, RefDate field. By entering this date I need to check the Account balance.

Thanks for your  reply.

kothandaraman_nagarajan
Active Contributor
0 Kudos

Hi,

Try this query:

SELECT distinct T0.[CardCode], T0.[CardName] as 'Custmer Name',  T3.[Name] as 'State',T2.[GroupName] , T0.[Balance] as 'Balance'   FROM OCRD T0  left JOIN CRD1 T1 ON T0.[CardCode] = T1.[CardCode] left JOIN OCRG T2 ON T0.[GroupCode] = T2.[GroupCode] left JOIN OCST T3 ON T1.[State] = T3.[Code] and T3.Country = T1.country  WHERE  T0.CardType = 'C' and T2.[GroupName] = [%0]

Thanks