MUST SPECIFY TABLE TO SELECT FROM ,2 RECEIVED ALERTS COULD NOT BE PREPARED

**Dear All, I get this Error"MUST SPECIFY TABLE TO SELECT FROM ,2 RECEIVED ALERTS COULD NOT BE PREPARED"** Please help me solve this
SELECT T1.AcctCode, T1.AcctName FROM OACT T1  WHERE (T1.AcctCode ='ACACBB0001' OR  T1.AcctCode ='ACACBBBP01' OR  T1.AcctCode ='ACACBBBP02' OR  T1.AcctCode ='ACACBBBP03' OR  T1.AcctCode ='ACACBBBP04' OR  T1.AcctCode ='LLFSLCC001' OR  T1.AcctCode ='LLFSLCC002' OR  T1.AcctCode ='LLFSLTL001' OR  T1.AcctCode ='LLFULFO001')
AND  T1.AcctCode   NOT IN (SELECT  T0.Account  FROM JDT1 T0 WHERE   T0.REFDATE<='[%0]' AND (T0.Account ='ACACBB0001' OR T0.Account ='ACACBBBP01' OR T0.Account ='ACACBBBP02' OR T0.Account ='ACACBBBP03' OR T0.Account ='ACACBBBP04' OR T0.Account ='LLFSLCC001' OR T0.Account ='LLFSLCC002' OR T0.Account ='LLFSLTL001' OR T0.Account ='LLFULFO001' ) )
Regrds
MD Zubair

change the query as
declare @date datetime
SELECT @date =  T0.refdate FROM JDT1 T0 WHERE T0.REFDATE ='[%0]'
SELECT T1.AcctCode, T1.AcctName FROM OACT T1 WHERE (T1.AcctCode ='ACACBB0001' OR T1.AcctCode ='ACACBBBP01' OR T1.AcctCode ='ACACBBBP02' OR T1.AcctCode ='ACACBBBP03' OR T1.AcctCode ='ACACBBBP04' OR T1.AcctCode ='LLFSLCC001' OR T1.AcctCode ='LLFSLCC002' OR T1.AcctCode ='LLFSLTL001' OR T1.AcctCode ='LLFULFO001')
AND T1.AcctCode NOT IN (SELECT T0.Account FROM JDT1 T0 WHERE T0.REFDATE<=@date AND (T0.Account ='ACACBB0001' OR T0.Account ='ACACBBBP01' OR T0.Account ='ACACBBBP02' OR T0.Account ='ACACBBBP03' OR T0.Account ='ACACBBBP04' OR T0.Account ='LLFSLCC001' OR T0.Account ='LLFSLCC002' OR T0.Account ='LLFSLTL001' OR T0.Account ='LLFULFO001' ) )

Similar Messages

  • Must specify table to select from

    hi everybody
    i think  sometime we received this error message:
    1).[Microsoft][SQL Server Native Client 10.0][SQL Server]Must specify table to selet from. 2).[Microsoft][SQL Server Native Client 10.0][SQL Server]Statment 'Contrato de Servicio' (OCTR)(s) could not be prepared.
    when i'm working in SQL Server the qry run fine, but when i run in SAP, i receive the error before mentioned.
    the Qry is this:
    DECLARE @FechaIni datetime,     
            @FechaFin datetime,
            @FechaAct datetime
    SET @FechaAct = GETDATE()
    SET @FechaIni = [%0]
    SET @FechaFin = [%1]
    CREATE TABLE #Libo_Mayor_CS (
                                    CodCta nvarchar(max),
                                    CtasPadre nvarchar(max),
                                    NbreCta nvarchar(max),
                                    Nivel numeric(1),
                                    Rubro numeric(1),
                                    SldoInicial numeric(19,6),
                                    Debe numeric(19,6),
                                    Haber numeric(19,6),
                                    SldoFinal numeric(19,6)
    INSERT INTO #Libo_Mayor_CS
    SELECT T0.[AcctCode],
           CASE
               WHEN T0.[Levels] <=3 THEN T0.[AcctName]
               ELSE  ''
           END,
           T0.[Levels],
           T0.[GroupMask],
           0.00,
           0.00,
           0.00,
           0.00                                          
    FROM OACT T0
         LEFT JOIN JDT1 T1 ON T0.[AcctCode] = T1.[Account]
    WHERE T0.[Levels] BETWEEN 1 AND 3 AND
          T0.[GroupMask]   BETWEEN 1 AND 5
    GROUP BY T0.[AcctCode],
             T1.[Account],
             T0.[Levels],
             T0.[AcctName],
             T0.[GroupMask]
    INSERT INTO #Libo_Mayor_CS
    SELECT T0.[AcctCode],
           CASE
               WHEN T0.[Levels] >3 THEN T0.[AcctName]
               ELSE  ''
           END,
           T0.[Levels],
           T0.[GroupMask],
           CASE
               WHEN T0.GroupMask  = 1 THEN (select t11.[CurrTotal]+sum(t10.[Debit])-sum(t10.[credit]) from oact t11 left join jdt1 t10 on t11.[AcctCode] = t10.[Account] where t10.[RefDate] between @FechaIni and @FechaAct and t11.[AcctCode] = T0.[AcctCode] group by t11.[CurrTotal])
               WHEN T0.GroupMask  = 2 THEN (select t11.[CurrTotal]-sum(t10.[Credit])-sum(t10.[Debit]) from oact t11 left join jdt1 t10 on t11.[AcctCode] = t10.[Account] where t10.[RefDate] between @FechaIni and @FechaAct and t11.[AcctCode] = T0.[AcctCode] group by t11.[CurrTotal])
               WHEN T0.GroupMask  = 4 THEN (select t11.[CurrTotal]+sum(t10.[Debit])-sum(t10.[credit]) from oact t11 left join jdt1 t10 on t11.[AcctCode] = t10.[Account] where t10.[RefDate] between @FechaIni and @FechaAct and t11.[AcctCode] = T0.[AcctCode] group by t11.[CurrTotal])
               WHEN T0.GroupMask  = 5 THEN (select t11.[CurrTotal]-sum(t10.[Credit])-sum(t10.[Debit]) from oact t11 left join jdt1 t10 on t11.[AcctCode] = t10.[Account] where t10.[RefDate] between @FechaIni and @FechaAct and t11.[AcctCode] = T0.[AcctCode] group by t11.[CurrTotal])
           END,
           SUM(T1.[Credit]),
           SUM(T1.[Debit]),
           0.00                                          
    FROM OACT T0
         LEFT JOIN JDT1 T1 ON T0.[AcctCode]  = T1.[Account]
    WHERE T0.[Levels] > 3 AND
          T0.[GroupMask]  BETWEEN 1 AND 5 AND
         (T1.[RefDate] between @FechaIni AND @FechaFin)
    GROUP BY T0.[AcctCode],
             T1.[Account],
             T0.[Levels],
             T0.[AcctName],
             T0.[GroupMask]
    SELECT A.[CodCta] 'Codigo de Cuenta',
           A.[CtasPadre] 'Cuentas Padre',
           A.[NbreCta] 'Nombre de Cuenta',
           A.[Nivel] 'Nivel',
           A.[Rubro] 'Rubro',
           A.[SldoInicial] 'Saldo Inicial',
           A.[Debe] 'Debito',
           A.[Haber] 'Credito',
           CASE
               WHEN A.[Rubro] = 1 THEN (A.[SldoInicial] + A.[Debe] - A.[Haber])
               WHEN A.[Rubro] = 2 THEN (A.[SldoInicial] + A.[Haber] - A.[Debe])
               WHEN A.[Rubro] = 4 THEN (A.[SldoInicial] + A.[Debe] - A.[Haber])
               WHEN A.[Rubro] = 5 THEN (A.[SldoInicial] + A.[Haber] - A.[Debe])
               ELSE 0
           END 'Saldo'
    FROM #Libo_Mayor_CS A
    ORDER BY A.[CodCta]
    DROP TABLE #Libo_Mayor_CS
    if  assign the value to variables directly the Qry run in SAP but when i change the comodin to capture the variables value of SAP , there is when the problem ocurre
    DECLARE @FechaIni datetime,     
                    @FechaFin datetime,
                    @FechaAct datetime
    SET @FechaAct = GETDATE()
    SET @FechaIni =  '20110601'
    SET @FechaFin = '20110630'
    i wait for your recomendations
    Edited by: AlexMeza on Jun 15, 2011 1:29 AM

    Hi all !
    Sorry because i dont know where post new.
    My issue, when i using querry manager to call store in Database like this
    Declare @Fromdate Datetime
    Declare @Todate Datetime
    Declare @AcctCode nvarchar (20)
    set @Fromdate = (select distinct (T1.RefDate) from OJDT T1 where T1.RefDate = '[%0]')
    set @Todate = (select distinct (T2.RefDate) from OJDT T2 where T2.RefDate = '[%1]')
    set @AcctCode = (select distinct(T3.AcctCode) from OACT as T3 where T3.AcctCode ='[%2]' )
    exec [USP_RPT_FI_GENERALLEDGER] @Fromdate, @Todate, @AcctCode
    and i run this querry
    this error:
    1). [Microsoft][SQL Server Native Client 10.0][SQL Server]Must specify table to select from. 2). [Microsoft][SQL Server Native Client 10.0][SQL Server]Statement 'Service Contracts' (OCTR) (s) could not be prepared.
    Please help me fix this issue
    Regards!
    John Le.

  • Error in query: [Microsoft][SQL Server Native Client 10.0][SQL Server]Must specify table to select from. '' (SWEI)

    Hi All
    below query giving me error in query generator but working well in Sql server.
    error: [Microsoft][SQL Server Native Client 10.0][SQL Server]Must specify table to select from. '' (SWEI)
    Select
    T1.U_grp01 As 'BA',T3.DocDate As 'Posting Date',Month(T3.DocDate) As 'PostMonth',Year(T3.DocDate) As 'PostYear',
    'AR Invoice' As 'Type',T3.DocNum As 'Doc No',T3.CardCode As 'Cust. Code',T3.CardName As 'Cust. Name',T5.SlpName As 'Sale Emp. Name',
    T4.IndustryC As 'Channel Type',T6.CityB As 'BillToCity',T7.Name As 'BillToState',T6.CityS As 'ShipToCity',T8.Name As 'ShipToState',
    T4.U_Une_Zone As 'Zone',
    T2.ItmsGrpNam As 'L1',T0.LineNum As 'Row No',T0.ItemCode As 'ItemCode',T0.Dscription As 'Item Name',t0.whscode,
    T0.Quantity As 'Quantity',T0.StockPrice As 'COGS Price',IsNull(Sum(T0.Quantity * T0.StockPrice),0) As 'COGS Value',T0.VatSum As 'Tax Amount',
    IsNull((Case When T3.DocType='I' Then (Case  When T0.Currency = 'INR' Then T0.PriceBefDi Else (T0.PriceBefDi * T0.Rate) End) Else T0.Price End) ,0) As 'Sales Price',
    IsNull((Case When T3.DocType='I' Then (Case  When T0.Currency = 'INR' Then T0.INMPrice Else (T0.INMPrice * T0.Rate) End) Else T0.Price End) ,0) As 'Sales Price',
    IsNull((Case When T3.DocType='I' Then (Case  When T0.Currency = 'INR' Then Sum(T0.Quantity * T0.INMPrice) Else Sum(T0.Quantity * T0.INMPrice * T0.Rate) End) Else T0.LineTotal End) ,0) As 'Sales Value',t9.linetotal as 'Freight',
    T3.DocType As 'DocType',
    (SELECT DISTINCT ISNULL (SUM(INV4.TaxSum),0)
    FROM INV4
    WHERE INV4.StaType = -90
    AND INV4.DocEntry = T3.DocEntry
    AND INV4.LineNum = T0.LineNum) AS 'BED',
    (SELECT DISTINCT ISNULL (SUM(INV4.TaxSum),0)
    FROM INV4
    WHERE INV4.StaType = -60
    AND INV4.DocEntry = T3.DocEntry
    AND INV4.LineNum = T0.LineNum) AS 'Cess',
    (SELECT DISTINCT ISNULL (SUM(INV4.TaxSum),0)
    FROM INV4
    WHERE INV4.StaType = 9
    AND INV4.DocEntry = T3.DocEntry
    AND INV4.LineNum = T0.LineNum) AS 'HeCess',
    (SELECT DISTINCT ISNULL (SUM(INV4.TaxSum),0)
    FROM INV4
    WHERE (INV4.StaType = 1 or inv4.staType = 8)
    AND INV4.DocEntry = T3.DocEntry
    AND INV4.LineNum = T0.LineNum) AS 'VAT',
    (SELECT DISTINCT ISNULL (SUM(INV4.TaxSum),0)
    FROM INV4
    WHERE INV4.StaType = 8
    AND INV4.DocEntry = T3.DocEntry
    AND INV4.LineNum = T0.LineNum) AS 'CST'
    From INV1 T0
    Left Join OITM T1 On T1.ItemCode=T0.ItemCode
    Left Join OITB T2 On T2.ItmsGrpCod=T1.ItmsGrpCod
    Left Join OINV T3 On T3.DocEntry=T0.DocEntry
    Left Join OCRD T4 On T4.CardCode=T3.CardCode
    Left Join OSLP T5 On T5.SlpCode=T4.SlpCode
    Left Join INV12 T6 On T6.DocEntry=T0.DocEntry
    Left Join OCST T7 On T7.Code=T6.StateB and T7.Country='IN'
    Left Join OCST T8 On T8.Code=T6.StateS and T8.Country='IN'
    left join inv3 t9 on t9.docentry = t3.docentry
    WHERE T3.[DocDate] >= [%0] and T3.[DocDate] <= [%1] and t3.U_UNE_GCAT = '2'
    Group By T1.U_grp01,T3.DocEntry,T3.DocNum,T3.DocDate,T0.LineNum,T3.CardCode,T3.CardName,T5.SlpName,T4.IndustryC,T4.U_Une_Zone,
    T6.CityB,T7.Name,T6.CityS,T8.Name,T0.VatSum,T0.Currency,T0.Rate,T3.DocType,T0.Price,T0.LineTotal,
    T2.ItmsGrpNam,T0.ItemCode,T0.Dscription,T0.StockPrice,T0.INMPrice,T0.PriceBefDi,T0.Quantity,t9.linetotal,t0.WhsCode
    Union All
    Select
    T1.U_grp01 As 'BA',T3.DocDate As 'Posting Date',Month(T3.DocDate) As 'PostMonth',Year(T3.DocDate) As 'PostYear',
    'AR Invoice' As 'Type',T3.DocNum As 'Doc No',T3.CardCode As 'Cust. Code',T3.CardName As 'Cust. Name',T5.SlpName As 'Sale Emp. Name',
    T4.IndustryC As 'Channel Type',T6.CityB As 'BillToCity',T7.Name As 'BillToState',T6.CityS As 'ShipToCity',T8.Name As 'ShipToState',
    T4.U_Une_Zone As 'Zone',
    T2.ItmsGrpNam As 'L1',T0.LineNum As 'Row No',T0.ItemCode As 'ItemCode',T0.Dscription As 'Item Name',t0.whscode,
    T0.Quantity As 'Quantity',T0.StockPrice As 'COGS Price',IsNull(Sum(T0.Quantity * T0.StockPrice),0) As 'COGS Value',T0.VatSum As 'Tax Amount',
    IsNull((Case When T3.DocType='I' Then (Case  When T0.Currency = 'INR' Then T0.PriceBefDi Else (T0.PriceBefDi * T0.Rate) End) Else T0.Price End) ,0) As 'Sales Price',
    IsNull((Case When T3.DocType='I' Then (Case  When T0.Currency = 'INR' Then T0.INMPrice Else (T0.INMPrice * T0.Rate) End) Else T0.Price End) ,0) As 'Sales Price',
    IsNull((Case When T3.DocType='I' Then (Case  When T0.Currency = 'INR' Then Sum(T0.Quantity * T0.INMPrice) Else Sum(T0.Quantity * T0.INMPrice * T0.Rate) End) Else T0.LineTotal End) ,0) As 'Sales Value',t9.linetotal as 'Freight',
    T3.DocType As 'DocType',
    (SELECT DISTINCT ISNULL (SUM(rin4.TaxSum),0)
    FROM rin4
    WHERE rin4.StaType = -90
    AND rin4.DocEntry = T3.DocEntry
    AND rin4.LineNum = T0.LineNum) AS 'BED',
    (SELECT DISTINCT ISNULL (SUM(rin4.TaxSum),0)
    FROM rin4
    WHERE rin4.StaType = -60
    AND rin4.DocEntry = T3.DocEntry
    AND rin4.LineNum = T0.LineNum) AS 'Cess',
    (SELECT DISTINCT ISNULL (SUM(rin4.TaxSum),0)
    FROM rin4
    WHERE rin4.StaType = 9
    AND rin4.DocEntry = T3.DocEntry
    AND rin4.LineNum = T0.LineNum) AS 'HeCess',
    (SELECT DISTINCT ISNULL (SUM(rin4.TaxSum),0)
    FROM rin4
    WHERE (rin4.StaType = 1 or rin4.staType = 8)
    AND rin4.DocEntry = T3.DocEntry
    AND rin4.LineNum = T0.LineNum) AS 'VAT',
    (SELECT DISTINCT ISNULL (SUM(rin4.TaxSum),0)
    FROM rin4
    WHERE rin4.StaType = 8
    AND rin4.DocEntry = T3.DocEntry
    AND rin4.LineNum = T0.LineNum) AS 'CST'
    From rin1 T0
    Left Join OITM T1 On T1.ItemCode=T0.ItemCode
    Left Join OITB T2 On T2.ItmsGrpCod=T1.ItmsGrpCod
    Left Join Orin T3 On T3.DocEntry=T0.DocEntry
    Left Join OCRD T4 On T4.CardCode=T3.CardCode
    Left Join OSLP T5 On T5.SlpCode=T4.SlpCode
    Left Join rin12 T6 On T6.DocEntry=T0.DocEntry
    Left Join OCST T7 On T7.Code=T6.StateB and T7.Country='IN'
    Left Join OCST T8 On T8.Code=T6.StateS and T8.Country='IN'
    left join rin3 t9 on t9.docentry = t3.docentry
    WHERE T3.[DocDate] >= [%0] and T3.[DocDate] <= [%1] and t3.U_UNE_GCAT = '2'
    Group By T1.U_grp01,T3.DocEntry,T3.DocNum,T3.DocDate,T0.LineNum,T3.CardCode,T3.CardName,T5.SlpName,T4.IndustryC,T4.U_Une_Zone,
    T6.CityB,T7.Name,T6.CityS,T8.Name,T0.VatSum,T0.Currency,T0.Rate,T3.DocType,T0.Price,T0.LineTotal,
    T2.ItmsGrpNam,T0.ItemCode,T0.Dscription,T0.StockPrice,T0.INMPrice,T0.PriceBefDi,T0.Quantity,t9.linetotal,t0.WhsCode
    Thanks in Advance

    Hi deepak..
    try this
    /* SELECT FROM OSRT P1 */
    DECLARE @FROM AS DATE
    /* WHERE */
    SET @FROM = /* P1.FromDate */ '[%1]'
    /* SELECT FROM OSRT P2 */
    DECLARE @TO AS DATE
    /* WHERE */
    SET @TO = /* P2.ToDate */ '[%2]';
    SELECT T1.U_grp01 AS 'BA',
           T3.DocDate AS 'Posting Date',
           MONTH(T3.DocDate) AS 'PostMonth',
           YEAR(T3.DocDate) AS 'PostYear',
           'AR Invoice' AS 'Type',
           T3.DocNum AS 'Doc No',
           T3.CardCode AS 'Cust. Code',
           T3.CardName AS 'Cust. Name',
           T5.SlpName AS 'Sale Emp. Name',
           T4.IndustryC AS 'Channel Type',
           T6.CityB AS 'BillToCity',
           T7.Name AS 'BillToState',
           T6.CityS AS 'ShipToCity',
           T8.Name AS 'ShipToState',
           T4.U_Une_Zone AS 'Zone',
           T2.ItmsGrpNam AS 'L1',
           T0.LineNum AS 'Row No',
           T0.ItemCode AS 'ItemCode',
           T0.Dscription AS 'Item Name',
           t0.whscode,
           T0.Quantity AS 'Quantity',
           T0.StockPrice AS 'COGS Price',
           ISNULL(SUM(T0.Quantity * T0.StockPrice), 0) AS 'COGS Value',
           T0.VatSum AS 'Tax Amount',
           ISNULL(
                   CASE
                        WHEN T3.DocType = 'I' THEN (
                                 CASE
                                      WHEN T0.Currency = 'INR' THEN T0.PriceBefDi
                                      ELSE (T0.PriceBefDi * T0.Rate)
                                 END
                        ELSE T0.Price
                   END
               0
           ) AS 'Sales Price',
           ISNULL(
                   CASE
                        WHEN T3.DocType = 'I' THEN (
                                 CASE
                                      WHEN T0.Currency = 'INR' THEN T0.INMPrice
                                      ELSE (T0.INMPrice * T0.Rate)
                                 END
                        ELSE T0.Price
                   END
               0
           ) AS 'Sales Price',
           ISNULL(
                   CASE
                        WHEN T3.DocType = 'I' THEN (
                                 CASE
                                      WHEN T0.Currency = 'INR' THEN SUM(T0.Quantity * T0.INMPrice)
                                      ELSE SUM(T0.Quantity * T0.INMPrice * T0.Rate)
                                 END
                        ELSE T0.LineTotal
                   END
               0
           ) AS 'Sales Value',
           t9.linetotal AS 'Freight',
           T3.DocType AS 'DocType',
               SELECT DISTINCT ISNULL(SUM(INV4.TaxSum), 0)
               FROM   INV4
               WHERE  INV4.StaType = -90
                      AND INV4.DocEntry = T3.DocEntry
                      AND INV4.LineNum = T0.LineNum
           ) AS 'BED',
               SELECT DISTINCT ISNULL(SUM(INV4.TaxSum), 0)
               FROM   INV4
               WHERE  INV4.StaType = -60
                      AND INV4.DocEntry = T3.DocEntry
                      AND INV4.LineNum = T0.LineNum
           ) AS 'Cess',
               SELECT DISTINCT ISNULL(SUM(INV4.TaxSum), 0)
               FROM   INV4
               WHERE  INV4.StaType = 9
                      AND INV4.DocEntry = T3.DocEntry
                      AND INV4.LineNum = T0.LineNum
           ) AS 'HeCess',
               SELECT DISTINCT ISNULL(SUM(INV4.TaxSum), 0)
               FROM   INV4
               WHERE  (INV4.StaType = 1 OR inv4.staType = 8)
                      AND INV4.DocEntry = T3.DocEntry
                      AND INV4.LineNum = T0.LineNum
           ) AS 'VAT',
               SELECT DISTINCT ISNULL(SUM(INV4.TaxSum), 0)
               FROM   INV4
               WHERE  INV4.StaType = 8
                      AND INV4.DocEntry = T3.DocEntry
                      AND INV4.LineNum = T0.LineNum
           ) AS 'CST'
    FROM   INV1 T0
           LEFT JOIN OITM T1
                ON  T1.ItemCode = T0.ItemCode
           LEFT JOIN OITB T2
                ON  T2.ItmsGrpCod = T1.ItmsGrpCod
           LEFT JOIN OINV T3
                ON  T3.DocEntry = T0.DocEntry
           LEFT JOIN OCRD T4
                ON  T4.CardCode = T3.CardCode
           LEFT JOIN OSLP T5
                ON  T5.SlpCode = T4.SlpCode
           LEFT JOIN INV12 T6
                ON  T6.DocEntry = T0.DocEntry
           LEFT JOIN OCST T7
                ON  T7.Code = T6.StateB
                AND T7.Country = 'IN'
           LEFT JOIN OCST T8
                ON  T8.Code = T6.StateS
                AND T8.Country = 'IN'
           LEFT JOIN inv3 t9
                ON  t9.docentry = t3.docentry
    WHERE  T3.[DocDate] >= @FROM
           AND T3.[DocDate] <= @TO
           AND t3.U_UNE_GCAT = '2'
    GROUP BY
           T1.U_grp01,
           T3.DocEntry,
           T3.DocNum,
           T3.DocDate,
           T0.LineNum,
           T3.CardCode,
           T3.CardName,
           T5.SlpName,
           T4.IndustryC,
           T4.U_Une_Zone,
           T6.CityB,
           T7.Name,
           T6.CityS,
           T8.Name,
           T0.VatSum,
           T0.Currency,
           T0.Rate,
           T3.DocType,
           T0.Price,
           T0.LineTotal,
           T2.ItmsGrpNam,
           T0.ItemCode,
           T0.Dscription,
           T0.StockPrice,
           T0.INMPrice,
           T0.PriceBefDi,
           T0.Quantity,
           t9.linetotal,
           t0.WhsCode
    UNION ALL
    SELECT T1.U_grp01 AS 'BA',
           T3.DocDate AS 'Posting Date',
           MONTH(T3.DocDate) AS 'PostMonth',
           YEAR(T3.DocDate) AS 'PostYear',
           'AR Invoice' AS 'Type',
           T3.DocNum AS 'Doc No',
           T3.CardCode AS 'Cust. Code',
           T3.CardName AS 'Cust. Name',
           T5.SlpName AS 'Sale Emp. Name',
           T4.IndustryC AS 'Channel Type',
           T6.CityB AS 'BillToCity',
           T7.Name AS 'BillToState',
           T6.CityS AS 'ShipToCity',
           T8.Name AS 'ShipToState',
           T4.U_Une_Zone AS 'Zone',
           T2.ItmsGrpNam AS 'L1',
           T0.LineNum AS 'Row No',
           T0.ItemCode AS 'ItemCode',
           T0.Dscription AS 'Item Name',
           t0.whscode,
           T0.Quantity AS 'Quantity',
           T0.StockPrice AS 'COGS Price',
           ISNULL(SUM(T0.Quantity * T0.StockPrice), 0) AS 'COGS Value',
           T0.VatSum AS 'Tax Amount',
           ISNULL(
                   CASE
                        WHEN T3.DocType = 'I' THEN (
                                 CASE
                                      WHEN T0.Currency = 'INR' THEN T0.PriceBefDi
                                      ELSE (T0.PriceBefDi * T0.Rate)
                                 END
                        ELSE T0.Price
                   END
               0
           ) AS 'Sales Price',
           ISNULL(
                   CASE
                        WHEN T3.DocType = 'I' THEN (
                                 CASE
                                      WHEN T0.Currency = 'INR' THEN T0.INMPrice
                                      ELSE (T0.INMPrice * T0.Rate)
                                 END
                        ELSE T0.Price
                   END
               0
           ) AS 'Sales Price',
           ISNULL(
                   CASE
                        WHEN T3.DocType = 'I' THEN (
                                 CASE
                                      WHEN T0.Currency = 'INR' THEN SUM(T0.Quantity * T0.INMPrice)
                                      ELSE SUM(T0.Quantity * T0.INMPrice * T0.Rate)
                                 END
                        ELSE T0.LineTotal
                   END
               0
           ) AS 'Sales Value',
           t9.linetotal AS 'Freight',
           T3.DocType AS 'DocType',
               SELECT DISTINCT ISNULL(SUM(rin4.TaxSum), 0)
               FROM   rin4
               WHERE  rin4.StaType = -90
                      AND rin4.DocEntry = T3.DocEntry
                      AND rin4.LineNum = T0.LineNum
           ) AS 'BED',
               SELECT DISTINCT ISNULL(SUM(rin4.TaxSum), 0)
               FROM   rin4
               WHERE  rin4.StaType = -60
                      AND rin4.DocEntry = T3.DocEntry
                      AND rin4.LineNum = T0.LineNum
           ) AS 'Cess',
               SELECT DISTINCT ISNULL(SUM(rin4.TaxSum), 0)
               FROM   rin4
               WHERE  rin4.StaType = 9
                      AND rin4.DocEntry = T3.DocEntry
                      AND rin4.LineNum = T0.LineNum
           ) AS 'HeCess',
               SELECT DISTINCT ISNULL(SUM(rin4.TaxSum), 0)
               FROM   rin4
               WHERE  (rin4.StaType = 1 OR rin4.staType = 8)
                      AND rin4.DocEntry = T3.DocEntry
                      AND rin4.LineNum = T0.LineNum
           ) AS 'VAT',
               SELECT DISTINCT ISNULL(SUM(rin4.TaxSum), 0)
               FROM   rin4
               WHERE  rin4.StaType = 8
                      AND rin4.DocEntry = T3.DocEntry
                      AND rin4.LineNum = T0.LineNum
           ) AS 'CST'
    FROM   rin1 T0
           LEFT JOIN OITM T1
                ON  T1.ItemCode = T0.ItemCode
           LEFT JOIN OITB T2
                ON  T2.ItmsGrpCod = T1.ItmsGrpCod
           LEFT JOIN [dbo].[Orin] T3
                ON  T3.DocEntry = T0.DocEntry
           LEFT JOIN OCRD T4
                ON  T4.CardCode = T3.CardCode
           LEFT JOIN OSLP T5
                ON  T5.SlpCode = T4.SlpCode
           LEFT JOIN rin12 T6
                ON  T6.DocEntry = T0.DocEntry
           LEFT JOIN OCST T7
                ON  T7.Code = T6.StateB
                AND T7.Country = 'IN'
           LEFT JOIN OCST T8
                ON  T8.Code = T6.StateS
                AND T8.Country = 'IN'
           LEFT JOIN rin3 t9
                ON  t9.docentry = t3.docentry
    WHERE  T3.[DocDate] >= @FROM
           AND T3.[DocDate] <= @TO
           AND t3.U_UNE_GCAT = '2'
    GROUP BY
           T1.U_grp01,
           T3.DocEntry,
           T3.DocNum,
           T3.DocDate,
           T0.LineNum,
           T3.CardCode,
           T3.CardName,
           T5.SlpName,
           T4.IndustryC,
           T4.U_Une_Zone,
           T6.CityB,
           T7.Name,
           T6.CityS,
           T8.Name,
           T0.VatSum,
           T0.Currency,
           T0.Rate,
           T3.DocType,
           T0.Price,
           T0.LineTotal,
           T2.ItmsGrpNam,
           T0.ItemCode,
           T0.Dscription,
           T0.StockPrice,
           T0.INMPrice,
           T0.PriceBefDi,
           T0.Quantity,
           t9.linetotal,
           t0.WhsCode
    rgds
    Kennedy

  • Error while executing SQL query -' Must Specify Table to select from'

    Hi all,
    While executing query using query generator
    it shows error message
    [Microsoft][SQL Native Client][SQL Server]Must specify table to select from.
    2). [Microsoft][SQL Nativ
    SELECT T1.ItemCode, T1.Dscription AS 'Item Description', T1.Quantity, T1.Price, T1.LineTotal,
    (Select SUM(T2.TaxSum) From PCH4 T2 Where T0.DocEntry=T2.DocEntry AND T2.staType=-90 AND T1.LineNum=T2.LineNum) as 'BEDAmt',
    (Select SUM(T2.TaxSum) From PCH4 T2 Where T0.DocEntry=T2.DocEntry AND T2.staType=-60 AND T1.LineNum=T2.LineNum) as 'ECSAmt',
    (Select SUM(T2.TaxSum) From PCH4 T2 Where T0.DocEntry=T2.DocEntry AND T2.staType=7 AND T1.LineNum=T2.LineNum) as 'HECSAmt',
    (Select SUM(T2.TaxSum) From PCH4 T2 Where T0.DocEntry=T2.DocEntry AND T2.staType=1 AND T1.LineNum=T2.LineNum) as 'VATAmt',
    (Select SUM(T2.TaxSum) From PCH4 T2 Where T0.DocEntry=T2.DocEntry AND T2.staType=4 AND T1.LineNum=T2.LineNum) as 'CSTAmt'
    FROM dbo.[OPCH] T0  INNER JOIN PCH1 T1 ON T0.DocEntry = T1.DocEntry INNER JOIN PCH4 T2 ON T2.DocEntry=T0.DocEntry
    WHERE T0.DocDate >='[%0]' AND  T0.DocDate <='[%1]' AND T0.DocType = 'I'
    GROUP BY T1.ItemCode,T1.Dscription,T1.Quantity, T1.Price, T1.LineTotal,T0.DocEntry,T1.DocEntry,T1.LineNum,T2.LineNum
    It's executing fine in MS SQL Server Studio Management.
    Please give y'r ideas to solve the problem.
    Jeyakanthan

    try this, it works fine in my B1:
    SELECT T1.ItemCode, T1.Dscription AS 'Item Description', T1.Quantity, T1.Price, T1.LineTotal,
    (Select SUM(T2.TaxSum) From PCH4 T2 Where T0.DocEntry=T2.DocEntry AND T2.staType=-90 AND T1.LineNum=T2.LineNum) as 'BEDAmt',
    (Select SUM(T2.TaxSum) From PCH4 T2 Where T0.DocEntry=T2.DocEntry AND T2.staType=-60 AND T1.LineNum=T2.LineNum) as 'ECSAmt',
    (Select SUM(T2.TaxSum) From PCH4 T2 Where T0.DocEntry=T2.DocEntry AND T2.staType=7 AND T1.LineNum=T2.LineNum) as 'HECSAmt',
    (Select SUM(T2.TaxSum) From PCH4 T2 Where T0.DocEntry=T2.DocEntry AND T2.staType=1 AND T1.LineNum=T2.LineNum) as 'VATAmt',
    (Select SUM(T2.TaxSum) From PCH4 T2 Where T0.DocEntry=T2.DocEntry AND T2.staType=4 AND T1.LineNum=T2.LineNum) as 'CSTAmt'
    FROM dbo.OPCH T0  INNER JOIN PCH1 T1 ON T0.DocEntry = T1.DocEntry INNER JOIN PCH4 T2 ON T2.DocEntry=T0.DocEntry
    WHERE T0.DocDate >='[%0]' AND  T0.DocDate <='[%1]' AND T0.DocType = 'I'
    GROUP BY T1.ItemCode,T1.Dscription,T1.Quantity, T1.Price, T1.LineTotal,T0.DocEntry,T1.DocEntry,T1.LineNum,T2.LineNum
    B1 don't like brackets!
    Regards

  • Must specift the table to select from error in query generator.

    SELECT OPCH.CardCode,OPCH.CardName, DateName(month,OPCH.TaxDate) + '-' + DateName(year,OPCH.TaxDate) As [Year],OPCH.TransId as [JE Ref],'IN' As [DocType]
    ,OPCH.DocEntry As [Base DocEntry],OPCH.WTSUM As [Recieved Amount],((OPCH.WTSUM/110.3) * 100 ) As [Invoice Amount],((OPCH.WTSUM/110.3) * 100 * 0.1) As [Service Tax]
    ,((OPCH.WTSUM/110.3) * 100 * 0.002) As [Edu.Cess],((OPCH.WTSUM/110.3) * 100 * 0.001) As [S.H.Cess]
    ,((OPCH.WTSUM/110.3) * 100 * 0.1) + ((OPCH.WTSUM/110.3) * 100 * 0.002) + ((OPCH.WTSUM/110.3) * 100 * 0.001) As [Total Service Tax]
    FROM OPCH,PCH1
    WHERE OPCH.DocEntry = PCH1.DocEntry
    AND OPCH.WTSUM > 0
    And PCH1.TargetType <> '19'
    AND OPCH.DocDate >= [%0]
    AND OPCH.DocDate <= [%1]
    When i try to run this query in query generator system gives me error msg  as "Must specify table to select from" if i remove the last two lines
    " AND OPCH.DocDate >= [%0]
    AND OPCH.DocDate <= [%1] "
    it works fine in the query generator.
    can any one help in this regards,
    thanks,
    praveen

    Hai Praveen!
    This problem is because of [%0] in query.
    Declare @FromDate as datetime
    Declare @ToDate as datetime
    set @FromDate = (select min(opch.docdate) from opch where opch.docdate >= '[%0]')
    set @ToDate = (select max(opch.docdate) from opch where opch.docdate <= '[%1]')
    Use this query in first lines of ur query and write your query.
    SELECT OPCH.CardCode,OPCH.CardName, DateName(month,OPCH.TaxDate) + '-' + DateName(year,OPCH.TaxDate) As Year,OPCH.TransId as JE Ref,'IN' As DocType
    ,OPCH.DocEntry As Base DocEntry,OPCH.WTSUM As Recieved Amount,((OPCH.WTSUM/110.3) * 100 ) As Invoice Amount,((OPCH.WTSUM/110.3) * 100 * 0.1) As Service Tax
    ,((OPCH.WTSUM/110.3) * 100 * 0.002) As http://Edu.Cess,((OPCH.WTSUM/110.3) * 100 * 0.001) As http://S.H.Cess
    ,((OPCH.WTSUM/110.3) * 100 * 0.1) + ((OPCH.WTSUM/110.3) * 100 * 0.002) + ((OPCH.WTSUM/110.3) * 100 * 0.001) As Total Service Tax
    FROM OPCH,PCH1
    WHERE OPCH.DocEntry = PCH1.DocEntry
    AND OPCH.WTSUM > 0
    And PCH1.TargetType '19'
    AND OPCH.DocDate >= @FromDate
    AND OPCH.DocDate <= @ToDate
    Regards,
    Thanga Raj.K

  • Server must specify table in Query Manager

    Dear All,
    I am using below query to generate information related to GRPO but getting error
    'microsoft sql server native client sql server must specify table to select from microsoft sql server native client Swei could not be prepared'
    SELECT Distinct  T7.DOCNUM AS ' INVOICE No.',T7.DocDate as 'Invoice Date',T7.TaxDate as 'Document Date',T7.DocDueDate,'PO','DocDate',T7.CardCode as 'Vendor Code',  T7.CARDNAME as 'Vendor Name',
    T7.NUMATCARD as 'Vendor Invoice No.', 
    T7.SHIPTOCODE as 'Ship To Code',T6.ITEMCODE,T6.DSCRIPTION,T6.Width1, cast(T15.UserText as VarChar) as 'Item Remarks',
    T6.QUANTITY,T6.WhsCode as 'Wh Name',T6.UnitMsr as 'UoM',T6.PRICE as 'Basic Price',T6.LineTotal as 'Basic Amount',
    T10.[TransCat] as 'Purchase Type',T6.U_InvoiceNo 'Vendor Invoice No',T6.U_InvDate 'Vendor Invoice Date',
    T7.Address As 'Bill To Address',T7.Address2 As 'Ship To Address',T7.U_CST,T7.U_VAT,T7.U_PAN,T12.[U_CreditRatPayer], T12.[U_CreditRatCheq], T12.[U_CreditRatPoints], T12.[U_DiscApp] ,
    T10.State as 'Vendor State',
    T15.[U_ItemType], T15.[U_Pattern], T15.[U_PurchaseType], T15.[U_Origin], T15.[U_ProductRange], T15.[U_NSD], T15.[U_Segment], T15.[U_SpeedRating],
    T15.[U_Brand], T15.[U_Category], T15.[U_CompoType], T15.[U_OTHBCategory], T15.[U_WidthIN], T15.[U_WidthCM], T15.[U_RimWidthIN],
    T15.[U_AspectRate], T15.[U_Plyrating], T15.[U_CountryMmanu], T15.[U_ProductType], T15.[U_Radiatyre], T15.[U_Loadindex], T15.[U_CategoryFTI], T15.[U_LoadindexFTI]
    FROM        
                          dbo.PDN1 T6  inner join OPDN T7 ON T6.DocEntry = T7.DocEntry LEFT JOIN
                          dbo.OITM T15 ON T15.ItemCode = T6.ItemCode  LEFT JOIN
                          dbo.OSLP T8 on T7.SLPCode = T8.SlpCode    LEFT JOIN
                          dbo.OHEM T9 on T7.OwnerCode = T9.empID    LEFT JOIN
                          dbo.PDN12 T10 on T7.Docentry = T10.DocEntry LEFT JOIN
       dbo.OCRD T12 on T7.CardCode = T12.CardCode
      Where  T6.TargetType <> '19' and  T15.U_ItemType = 'Tyre' and  T7.DocDate >= '[%0]' and T7.DocDate <= '[%1]'
    We tried to declare variable but error still appears.
    Thanks
    Deepak

    Try This
    /* select docdate from OPDN t1 */
    DECLARE @d1 AS DATETIME
    DECLARE @d2 AS DATETIME
    SET @d1 =/* t1.docdate */ '[%0]'
    SET @d2 =/* t1.docdate */ '[%1]'
    SELECT DISTINCT T7.DOCNUM             AS ' INVOICE No.',
           T7.DocDate                     AS 'Invoice Date',
           T7.TaxDate                     AS 'Document Date',
           T7.DocDueDate,
           'PO',
           'DocDate',
           T7.CardCode                    AS 'Vendor Code',
           T7.CARDNAME                    AS 'Vendor Name',
           T7.NUMATCARD                   AS 'Vendor Invoice No.',
           T7.SHIPTOCODE                  AS 'Ship To Code',
           T6.ITEMCODE,
           T6.DSCRIPTION,
           T6.Width1,
           CAST(T15.UserText AS VARCHAR)  AS 'Item Remarks',
           T6.QUANTITY,
           T6.WhsCode                     AS 'Wh Name',
           T6.UnitMsr                     AS 'UoM',
           T6.PRICE                       AS 'Basic Price',
           T6.LineTotal                   AS 'Basic Amount',
           T10.[TransCat]                 AS 'Purchase Type',
           T6.U_InvoiceNo 'Vendor Invoice No',
           T6.U_InvDate 'Vendor Invoice Date',
               SELECT DISTINCT ISNULL(SUM(PDN4.taxsum), 0)
               FROM   PDN4
               WHERE  PDN4.statype = 10
                      AND PDN4.docentry = T7.Docentry
                      AND PDN4.linenum = T6.Linenum
           )                                 BED,
               SELECT DISTINCT ISNULL(SUM(PDN4.taxsum), 0)
               FROM   PDN4
               WHERE  PDN4.statype = 11
                      AND PDN4.docentry = T7.Docentry
                      AND PDN4.linenum = T6.Linenum
           )                                 Cess,
               SELECT DISTINCT ISNULL(SUM(PDN4.taxsum), 0)
               FROM   PDN4
               WHERE  PDN4.statype = 12
                      AND PDN4.docentry = T7.Docentry
                      AND PDN4.linenum = T6.Linenum
           )                                 HeCess,
               SELECT DISTINCT ISNULL(SUM(PDN4.taxsum), 0)
               FROM   PDN4
               WHERE  PDN4.statype = 5
                      AND PDN4.docentry = T7.Docentry
                      AND PDN4.linenum = T6.Linenum
           )                                 ServiceTax,
               SELECT DISTINCT ISNULL(SUM(PDN4.taxsum), 0)
               FROM   PDN4
               WHERE  PDN4.statype = 6
                      AND PDN4.docentry = T7.Docentry
                      AND PDN4.linenum = T6.Linenum
           )                                 ServiceCess,
               SELECT DISTINCT ISNULL(SUM(PDN4.taxsum), 0)
               FROM   PDN4
               WHERE  PDN4.statype = -10
                      AND PDN4.docentry = T7.Docentry
                      AND PDN4.linenum = T6.Linenum
           )                                 ServiceHeCess,
               SELECT DISTINCT ISNULL(SUM(PDN4.taxsum), 0)
               FROM   PDN4
               WHERE  PDN4.statype = 1
                      AND PDN4.docentry = T7.Docentry
                      AND PDN4.linenum = T6.Linenum
           )                                 VAT,
               SELECT DISTINCT ISNULL(SUM(PDN4.taxsum), 0)
               FROM   PDN4
               WHERE  PDN4.statype = 7
                      AND PDN4.docentry = T7.Docentry
                      AND PDN4.linenum = T6.Linenum
           )                                 Surcharge,
               SELECT DISTINCT ISNULL(SUM(PDN4.taxsum), 0)
               FROM   PDN4
               WHERE  PDN4.statype = 8
                      AND PDN4.docentry = T7.Docentry
                      AND PDN4.linenum = T6.Linenum
           )                                 EntryTax,
               SELECT DISTINCT ISNULL(SUM(PDN4.taxsum), 0)
               FROM   PDN4
               WHERE  PDN4.statype = 4
                      AND PDN4.docentry = T7.Docentry
                      AND PDN4.linenum = T6.Linenum
           )                                 CST,
           STR(
                   SELECT (PDN3.[LineTotal] * T6.[LineTotal]) / (T7.[Doctotal] -T7.[TotalExpns] -T6.[VatSum])
                   FROM   PDN3
                   WHERE  PDN3.docentry = T7.Docentry
                          AND PDN3. ExpnsCode = '1'
               19,
               2
           )                              AS 'Freight',
           T7.[WTSum] * T6.[LineTotal] / (T7.[Doctotal] -T7.[TotalExpns] -T7.[VatSum] + T7.[WTSum]) AS
           'TDS',
           T7.DocTotal * T6.[LineTotal] / (T7.[Doctotal] -T7.[TotalExpns] -T7.[VatSum] + T7.[WTSum]) AS
           'DocTotal',
           T6.Freetxt                     AS ' Text',
           T8.[SlpName],
           (T9.[firstName] + ' ' + T9.[lastName]) AS 'Owner',
           T7.Address                     AS 'Bill To Address',
           T7.Address2                    AS 'Ship To Address',
           T7.U_CST,
           T7.U_VAT,
           T7.U_PAN,
           T12.[U_CreditRatPayer],
           T12.[U_CreditRatCheq],
           T12.[U_CreditRatPoints],
           T12.[U_DiscApp],
           T10.State                      AS 'Vendor State',
           T15.[U_ItemType],
           T15.[U_Pattern],
           T15.[U_PurchaseType],
           T15.[U_Origin],
           T15.[U_ProductRange],
           T15.[U_NSD],
           T15.[U_Segment],
           T15.[U_SpeedRating],
           T15.[U_Brand],
           T15.[U_Category],
           T15.[U_CompoType],
           T15.[U_OTHBCategory],
           T15.[U_WidthIN],
           T15.[U_WidthCM],
           T15.[U_RimWidthIN],
           T15.[U_AspectRate],
           T15.[U_Plyrating],
           T15.[U_CountryMmanu],
           T15.[U_ProductType],
           T15.[U_Radiatyre],
           T15.[U_Loadindex],
           T15.[U_CategoryFTI],
           T15.[U_LoadindexFTI]
    FROM   dbo.PDN1 T6
           INNER JOIN OPDN T7
                ON  T6.DocEntry = T7.DocEntry
           LEFT JOIN dbo.OITM T15
                ON  T15.ItemCode = T6.ItemCode
           LEFT JOIN dbo.OSLP T8
                ON  T7.SLPCode = T8.SlpCode
           LEFT JOIN dbo.OHEM T9
                ON  T7.OwnerCode = T9.empID
           LEFT JOIN dbo.PDN12 T10
                ON  T7.Docentry = T10.DocEntry
           LEFT JOIN dbo.OCRD T12
                ON  T7.CardCode = T12.CardCode
    WHERE  T6.TargetType <> '19'
           AND T15.U_ItemType = 'Tyre'
           AND T7.DocDate >= @d1
           AND T7.Docdate <= @d2

  • Insert into table a (select * from table b) - need pk?

    Hi there.
    I'm going to insert into table FINAL (select * from table STAGING) - same structure but in STAGING the ID column has nulls.
    Do I need to provide the ID (primary key) for table FINAL or will it get created based on sequence/trigger?
    If I were doing this in a loop I'd get the next val from the sequence but on a simple insert, I'm curious.
    thanks!

    hmm.. what is ?
    it didn't like it.
    Error(11,4): PLS-00103: Encountered the symbol "[" when expecting one of the following:     begin case declare exit for goto if loop mod null pragma    raise return select update while with <an identifier>    <a double-quoted delimited-identifier> <a bind variable> <<    close current delete fetch lock insert open rollback    savepoint set sql execute commit forall merge    <a single-quoted SQL string> pipe
    9i, sqldeveloper                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Only one expression can be specified in the select list when the subquery is not introduced with EXISTS.

    hi all
    i have a table that name is:
    TiketsHeader 
    but i used this code
    SELECT TicketsHeaderId, Active, TH.PersonRef,P.Fname + ' ' + P.Lname AS NF, Serial, TicketsCnt, StartSerial, EndSerial, KindDate, StratDate, EndDate,
    MonthsRef1,(SELECT * FROM dbo.Months M WHERE M.MonthsId= MonthsRef1 ) AS MonthsName1 , MonthsRef2, MonthsRef3, WeekDaysRef,
    PoolTimesRef, TH.Descreption
    FROM dbo.TiketsHeader TH
    INNER JOIN Person P ON P.PersonId= TH.PersonRef
    i see this error:
    Msg 116, Level 16, State 1, Line 2
    Only one expression can be specified in the select list when the subquery is not introduced with EXISTS.
    how to solve it
    please help me
    Name of Allah, Most Gracious, Most Merciful and He created the human

    SELECT TicketsHeaderId, Active, TH.PersonRef,P.Fname + ' ' + P.Lname AS NF, Serial, TicketsCnt, StartSerial, EndSerial, KindDate, StratDate, EndDate,
    MonthsRef1,(SELECT * FROM dbo.Months M WHERE M.MonthsId= MonthsRef1 ) AS MonthsName1 , MonthsRef2, MonthsRef3, WeekDaysRef,
    PoolTimesRef, TH.Descreption
    FROM dbo.TiketsHeader TH
    INNER JOIN Person P ON P.PersonId= TH.PersonRef
    A Sub query like this can only return one column, not serveral like here with the star *. Replace the star by one column Name that you want to query.
    Olaf Helper
    [ Blog] [ Xing] [ MVP]

  • Msg 116, Level 16, State 1, Line 6 Only one expression can be specified in the select list when the subquery is not introduced with EXISTS.

    Hello,
    Can anyone help me?
    select year(po.rdata) as 'Ano', 
    sum(etotal) as 'Valorp' ,
    (select year(fo.data),Sum(etotal) 
    FROM fo (nolock) 
    where  not exists ( select 1 from pl (nolock) where pl.adoc = fo.adoc and pl.cm = fo.doccode ) 
    group by year(fo.data))as 'Valorap'   
    from po 
    group by year(po.rdata)
    order by year(po.rdata)
    Error 
    Msg 116, Level 16, State 1, Line 6
    Only one expression can be specified in the select list when the subquery is not introduced with EXISTS.
    Consultora

    Hi Prashanth,
    select year(po.rdata) as 'Ano',
    sum(etotal) as 'Valorp' ,
    (select Sum(etotal)
    FROM fo (nolock)
    where not exists ( select 1 from pl (nolock) where pl.adoc = fo.adoc and pl.cm = fo.doccode )
    group by year(fo.data))as 'Valorap'
    from po(nolock)
    group by year(po.rdata)
    order by year(po.rdata)
    Gives me the error: 
    Msg 512, Level 16, State 1, Line 1
    Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.
    Thanks
    Consultora

  • Party Resource selected from the Assignment Manager is not available on SR

    Party Resource selected from the Assignment Manager is not available on Service Request.
    Hi,
    Im working on Oracle Customer Support and observed the following.
    I imported a party (dealer) from AR and created it as a resource.
    Then created a Service Request, assigned Tasks to the service request and then tried to assign the task to the imported resource using Assignment Manager.
    In the assignment manager searched for the resources using Unassisted search. In the resource type selected 'Party Resource'. Found the party resources by clicking on the search button.
    Double clicked on the party resource and specified the Start Time and End Time.
    After clicking on the Ok button, the selected party resource is not available in the Service Request Form.
    Can somebody please help me in this matter. I want the party resource on the service request form.
    Thanks in advance.
    Regards
    Anil

    Shiv,
    Thank you for your reply. I don't have access to the production instance..but I will definitely recommend the solution. I did these steps in test instances earlier whenever I had this error. But they used to go away after bouncing app server.
    Now, some of the functions are available to the responsibility without any modifications..seems like it takes a while for the newly added functions to a menu to propagate in the E-Business system.
    What confounds me is that even after a mid-tier bounce, the system didn't pickup the menu changes.
    Regards,
    Arun

  • From an iPhone 5, I receive the following error message when trying to download content from a radio show app:  "Alert Could not parse feed."   How do I fix?

    From an iPhone 5, I receive the following error message when trying to download content from a radio show app:  "Alert Could not parse feed."   How do I fix?

    Since you're using a 3rd party app, suggest contacting the app developer or looking at their support site for help.

  • Every time I try to export my movie from iMovie, I keep getting a message that states, "Unable to prepare project for publication. The project could not be prepared for publication because an error occurred. (-50). HELP

    Every time I try to export my movie from iMovie, I keep getting a message that states, "Unable to prepare project for publication. The project could not be prepared for publication because an error occurred. (-50). HELP

    Hi
    Error -50 paramErr  Error in user parameter list
    Can there be any external hard disks - if so How is/are it/they formatted ? Must be Mac OS Extended (hfs) if used for Video.
    UNIX/DOS/FAT32/Mac OS Exchange - works for most but not for VIDEO.
    What this means in Your situation is above me.
    • free space on internal boot hard disk? How much ?
    Video codec
    • streamingDV, AIC etc. (not .avi, .mp4, .m4v, .wmv etc as they are containers not codecs)
    Pictures
    • in what format ? .jpg, .bmp, .tif, else ?
    Audio
    • from where/what format ? iTunes, .avi, .mp3, .aiff, else ?
    Trash the Preference file:
    The "com.apple.iMovie.plist" file
    Many users has not observed that there are TWO libraries.
    • Library - at root level
    • Library - in user/account folder - THIS IS THE ONE to look into
    from Luke Burns
    I fixed the problem.. but it was very, very strange. I had a very long section for credits and set the line spacing to 1.0.. for some reason this caused it. I removed it, and it worked fine. I put it back, and I couldn't preview or play the video.
    I don't know why that could cause that big of a problem, but it did..
    Klaus1
    You need more free space on your hard drive.
    jonorparkerjon
    After phone support from apple I ended up creating a new project and adding all 117 clips back in individually till I found out what clips flagged and would not allow me to export. I had 3 I deleted and replaced and everything works now 1hr after tedious work....
    Where do Your material come from
    • Camera
    • External hard disk
    • USB-memory
    And all are connected so that iMovie can find it ?
    from: jonorparkerjon
    After phone support from apple I ended up creating a new project and adding all 117 clips back in individually till I found out what clips flagged and would not allow me to export. I had 3 I deleted and replaced and everything works now 1hr after tedious work....
    from Karsten S
    Shorter clips than 1,5 sec might be one of the culptrits
    Bengt cont.
    Set-Up might differ
    • Mac OS - most probably X.7 or more
    • iMovie version - more than iM'11 v. 9.0.4
    Action taken
    • Finalizing project - I never do as I never understood the gain to do so
    • Share as HD to iDVD - never give any gain but if it works the resulting DVD is less quality than if SD-quality was shared
    fps - set
    •I only use PAL (25fps)
    Yours Bengt W

  • The data from the infoprovider involved could not be checked'

    Hi all,
    In the the selection screen of the virtual provider through the option display data, am getting message text " the data from the infoprovider involved could not be checked" , and then it brings all the data from the r/3 function module irrespective of the selection by date in the virtual info provider. I am retrieving the data from r/3 function module(RFC) to bw function module assign to virtual infoprovider.
    with regards,
    Ram

    Hi
    A Virtual Provider does not store data. to view the data in it you will have to use it in a query and check its data.
    Thanks,
    Rajesh.
    Please provide points to answers if you find them helpful

  • After connecting my Apple TV this morning, I have no sound. It is hooked up to play through my television speakers. Any ideas on how to get sound? Also, I tried hooking it up through my surround receiver, but could not get it to come up on my ty screen.

    After connecting my Apple TV this morning, I have no sound. It is hooked up to play through my television speakers. Any ideas on how to get sound? Also, I tried hooking it up through my surround receiver, but could not get it to come up on my ty screen, what can I do to correct this problem?

    Have you tried adjusting the "Audio Out" and the "Dolby Digital" settings in settings > audio and video? It may be worth trying several combinations of these settings, although typically it is the "Dolby Digital" setting that causes most problems for users.
    Also make sure that you have correctly mapped the input port on your sound system to the output, if you are unsure about how to do this, refer to the manual that came with your sound system.
    Have you tried playing various content sources (i.e. podcasts, music, iTunes Store video, other video etc), do you have the same problem with all types of content? If you use optical you might also check that you can see a red light at the end of your optical audio cable. Is your optical audio cable plugged straight into your sound system, or does it go through a switch or other device?

  • I am receiving the 'Could not sign you in [Access denied: 530]. Check your user name and password' problem on Adobe Muse CC 2014 and I cannot access the xml file that is supposed to fix this issue?

    I am a PC user and I have Adobe Creative Cloud Muse 2014. I have received the 'Could not sign you in [Access denied: 530]. Check your user name and password' error when trying to upload my muse site to my ftp host, GoDaddy. I have successfully done this in the past and only recently it has stopped working. I looked online at the FAQ Adobe Muse Help | Uploading an Adobe Muse Site to a third-party hosting service and it said to download the ftpprefs.xml file but this file simply leads to a blank page that says /*Not found*//*Not found*/.
    Can someone direct me to a working page with this file or provide a different solution? Thank you!

    Hello,
    As you are getting error [Access denied: 530] it means issue is with access. Either the username and password you are entering is incorrect or you do not have proper permissions.
    I would suggest you to contact Godaddy to either reset password or reset the permissions.
    Regards
    Vivek

Maybe you are looking for

  • Idoc Type Mismatch in Source & BW Systems

    Hi Friends My problem goes as follows I have BW development system and R/3 Development systems.Both this comination was working fine.Suddenly we had system copy of R/3 Production on R/3 Development for some testing.Now BW source system turns inactive

  • What is the best way to achieve this

    site is here much like a "drop shadow" on the content into the background i have an image that repats on the y axis.....it is a film strip... this is my issue.... i have the bacground image defined in the #wrapper div as follows div#wrapper { margin:

  • Videos showing up as album art

    This is really weird....I press play on my videos and they show the first frame as the album art...audio still works fine. I'm using firmware 1.0 and the same videos worked yesterday.

  • Question as to why I can't read online pdfs

    I am unable to read pdfs in Safari. Suddenly. I have Adobe Reader  11.0.04. What should I do?

  • How to import from ITunes in normal AAC file? (not protected)

    How do I import from Itunes in a normal AAC file? (ideally in 320kbps) but most important, not a protected file! Alternatively, how do I convert from protected aac to normal aac? Tks for you help.