on 06-28-2016 2:16 PM
Hi
i have created a query based on A/R Invoice in which i need to show Delivery Document No
SELECT T0.[CardCode] as 'Business Partner Code', T0.[CardName] as 'Business Partner',convert(varchar(10),
T0.[DocDate],105) as 'Invoice Date',
T0.[DocNum] as 'Invoice No', T0.[DocTotal] as 'Invoice Amount',
T0.[PaidtoDate] as 'Invoice Paid Amount', (T0.[docTotal] - T0.[PaidtoDate]) as 'Remaining Invoice Amount',
case T0.[DocStatus]
when ('C') then 'Closed'
when ('O') then 'Open'
else 'Invalid Parameters' end AS 'Status'
FROM OINV T0
where CardCode between @CardCodeFrom and @CardCodeTo and DocDate between @DocFromDate and @DocToDate
END
Regards
Hi,
Please try this,
SELECT T0.[CardCode] as 'Business Partner Code', T0.[CardName] as 'Business Partner',convert(varchar(10),
T0.[DocDate],105) as 'Invoice Date',
T0.[DocNum] as 'Invoice No', T0.[DocTotal] as 'Invoice Amount',
T0.[PaidtoDate] as 'Invoice Paid Amount', (T0.[docTotal] - T0.[PaidtoDate]) as 'Remaining Invoice Amount',
case T0.[DocStatus]
when ('C') then 'Closed'
when ('O') then 'Open'
else 'Invalid Parameters' end AS 'Status', T1.BaseRef as DO
FROM OINV T0 INNER JOIN INV1 on T0.docentry = T1.Docentry
where CardCode between @CardCodeFrom and @CardCodeTo and DocDate between @DocFromDate and @DocToDate
END
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
sorry missed T1,
SELECT T0.[CardCode] as 'Business Partner Code', T0.[CardName] as 'Business Partner',convert(varchar(10),
T0.[DocDate],105) as 'Invoice Date',
T0.[DocNum] as 'Invoice No', T0.[DocTotal] as 'Invoice Amount',
T0.[PaidtoDate] as 'Invoice Paid Amount', (T0.[docTotal] - T0.[PaidtoDate]) as 'Remaining Invoice Amount',
case T0.[DocStatus]
when ('C') then 'Closed'
when ('O') then 'Open'
else 'Invalid Parameters' end AS 'Status', T1.BaseRef as DO
FROM OINV T0 INNER JOIN INV1 T1 ON T0.[DocEntry] = T1.[DocEntry]
where CardCode between @CardCodeFrom and @CardCodeTo and DocDate between @DocFromDate and @DocToDate
END
User | Count |
---|---|
97 | |
11 | |
11 | |
6 | |
6 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.