on 2014 Jun 24 7:17 AM
No data while executing this query .Please Help
Declare @FrmDate as date
Declare @ToDate as date
Declare @series as Varchar(10)
SELECT T2.[CardCode] AS 'Customer/Vendor Code', T2.[CardName] AS 'Customer/Vendor Name',
T2.[DocNum] AS 'Document Number',T3.SeriesName, T1.[SumApplied] AS 'Paid to Invoice',
T2.[DocDate] AS 'Posting Date', T0.[DocNum] AS 'Document Number',
T0.[DocDate] AS 'Posting Date'
FROM [dbo].[OINV] T0 INNER JOIN [dbo].[RCT2] T1 ON T1.[DocEntry] = T0.[DocEntry]
INNER JOIN [dbo].[ORCT] T2 ON T2.[DocNum] = T1.[DocNum]
INNER JOIN [dbo].[NNM1] T3 ON T2.Series = T3.Series
WHERE T2.[DocDate] between @FrmDate and @ToDate and T3.SeriesName = @series
Hi,
To get result from above query, you have set values for declared variables. Try this query for date and same way try for series.
Declare @FrmDate as datetime
Declare @ToDate as datetime
Set @FrmDate = (Select min(t0.Docdate) from dbo.ORCT t0 where t0.Docdate >='[%1]')
Set @ToDate = (Select max(t1.Docdate) from dbo.ORCT t1 where t1.Docdate <='[%2]')
SELECT T2.[CardCode] AS 'Customer/Vendor Code', T2.[CardName] AS 'Customer/Vendor Name',
T2.[DocNum] AS 'Document Number',T3.SeriesName, T1.[SumApplied] AS 'Paid to Invoice',
T2.[DocDate] AS 'Posting Date', T0.[DocNum] AS 'Document Number',
T0.[DocDate] AS 'Posting Date'
FROM [dbo].[OINV] T0 INNER JOIN [dbo].[RCT2] T1 ON T1.[DocEntry] = T0.[DocEntry]
INNER JOIN [dbo].[ORCT] T2 ON T2.[DocNum] = T1.[DocNum]
INNER JOIN [dbo].[NNM1] T3 ON T2.Series = T3.Series
WHERE T2.[DocDate] between @FrmDate and @ToDate
Thanks & Regards,
Nagarajan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
105 | |
9 | |
8 | |
6 | |
5 | |
5 | |
4 | |
4 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.