Home Forums SQL Server 2008 T-SQL (SS2K8) You have written a subquery that can return more than one field without using the EXISTS reserved word in the main query's FROM clause. Revise the SELECT statement of the subquery to request only one field. RE: You have written a subquery that can return more than one field without using the EXISTS reserved word in the main query's FROM clause. Revise the SELECT statement of the subquery to request only one field.

  • declare @Description varchar(50) = "textbox_search.Text.Trim()"

    SELECT IT.tr_id AS [Tr Id], IT.tr_date AS [Tr Date], IT.tr_type AS [Tr Type]

    , IT.tr_no AS [Tr No], IT.item_id AS [Item Id], IT.item_no AS [Item No]

    , IT.item_des AS [Description], IT.item_unit AS [Item Unit], IT.sale_rate AS [Sales Rate]

    , IT.pur_rate_on_sale AS [Pur Rate], IT.discount_amount AS [Discount]

    , IT.tax_amount AS [Tax], IT.cr_qty AS [Qty], IT.acc_no AS [Account No]

    , IT.item_location AS [Location]

    , INV.invoice_no AS [Invoice No]

    , INV.invoice_date AS [Invoice Date]

    FROM tbl_items_trans IT

    left join tbl_invoices INV on IT.invoice_no = INV.invoice_no

    WHERE (IT.tr_type = 'SALE' AND IT.item_des LIKE '%' + @Description + '%' )

    Catch-all queries done right [/url]
    Gail Shaw's Performance Blog[/url]