Skip to Content
0
Former Member
Jun 12, 2009 at 02:01 AM

Selection Criteria

24 Views

hai expert...

how to use Query selection criteria input customer name start and end

this my Query

Declare @FromDate datetime

Declare @Todate datetime

set @FromDate = (select min(S0.DocDate) from OINV S0 where S0.DocDate >= '[%0]')

set @ToDate = (select max(S1.DocDate) from OINV S1 where S1.DocDate <= '[%1]')

Select

P0.DocNum as 'Invoice Number',

P0.CardName as 'Customer Name',

P0.DocDate as 'Invoice Date ',

P0.DocTotal as 'Invoice Value ',

P0.DocDueDate as 'Invoice Due Date',

V0.DocNum as 'Incoming Payment Date ',

V0.DocDate,

(case

when V0.CashSum > 0 then 'Cash'

when V0.CheckSum > 0 then 'Check'

when V0.TrsfrSum > 0 then 'Bank transfer'

Else 'Deduction'

end) as 'Payment Type',

V0.TaxDate as 'Due Date Check/Cash/Bank Transfer',

V0.CounterRef as 'Payment Status',

V0.DocTotal as 'Incoming Value',

DAY(V0.TaxDate)-DAY(P0.DocDueDate) as 'Due Date Payment Variance'

From OINV P0, ORCT V0, RCT2 V2

Where

V0.Docentry=V2.DocNum and

V2.Docentry = P0.Docentry and

P0.DocDate >= @FromDate and

P0.DocDate <= @ToDate

thanks...