Hi I am trying to create a cyrstal report which is based of two tables. Both the tables have similar data in them. below is the query i wrote but it doesn't seem to be working....what am i doing wrong?
Code:
SELECT "Table_A"."Account", "Table_A"."Accounting_Date", "Table_B"."Account", Substring("Table_A"."Account",13,4), "Table_B"."Debit"+"Table_B"."Credit"
, Right("Table_A"."Account",9), "Table_A"."Debit" + "Table_A"."Credit"
FROM "Table_B" "Table_B" INNER JOIN "Table_A" "Table_A" ON ((((((("Table_B"."Account"="Table_A"."Account") AND ("Table_B"."Accounting_Date"="Table_A"."Accounting_Date")) AND ("Table_B"."Journal"="Table_A"."Journal")) AND ("Table_B"."Run_Number"="Table_A"."Run_Number")) AND ("Table_B"."Sequence_Number"="Table_A"."Sequence_Number")) AND ("Table_B"."Application_of_Origin"="Table_A"."Application_of_Origin")) AND ("Table_B"."Batch"="Table_A"."Batch")) AND ("Table_B"."Source"="Table_A"."Source")
WHERE Right("Table_A"."Account",9)='1160.9890' AND Substring("Table_A"."Account",13,4)='1160' AND "Table_A"."Accounting_Date"<={d '2012-01-31'}
ORDER BY "Table_A"."Account", "Table_B"."Account"