"SELECT custmast.cust_id, setup_sales.shop_name, " & _ "{fn YEAR(inhouse.transaction_date-2)},(SELECT COUNT(DISTINCT ((inhouse.transaction_date-2))) FROM sales.dbo.inhouse inhouse, sales.dbo.custmast custmast " & _ "WHERE inhouse.card_id = custmast.card_id AND custmast.cust_id='" & custid & "' AND inhouse.transaction_date>='" & qdate & "' AND inhouse.transaction_date<='" & qdate2 & "' )" & _ "FROM sales.dbo.custmast custmast , sales.dbo.transactions transactions , sales.dbo.inhouse inhouse , sales.dbo.setup_sales setup_sales " & _ "WHERE custmast.cust_id='" & custid & "' AND inhouse.card_id = custmast.card_id AND inhouse.table_id = setup_sales.table_id AND " & _ "transactions.transaction_type = setup_sales.transaction_type AND inhouse.table_id = setup_sales.table_id AND " & _ "inhouse.transaction_date>='" & qdate & "'And inhouse.transaction_date<='" & qdate2 & "' ORDER BY setup_sales.shop_name", Conn, , , adCmdText
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)