I am trying to build a command temp table to use in Crystal Reports but to link to another table, I need to take a sequence number and subtract 1 so it matches the sequence number in the joined table. I keep getting an error "error in assignment" and "expression evaluation error". I can successfully put a formula in the report and then do a subquery and link on run and sequence but then when the linked sub is blank, I still get the detail. Maybe it is just something with the Sage 300 ODBC that does not allow for this but you can say field=1 in a where clause so it knows that it is a number field. I have tried writing this with and without " around the table.field, putting a bracket around the formula, etc. Thoughts?
Here is the SQL statement:
SELECT CMT_REGISTER__TRANSACTION.Bank_Account, CMT_REGISTER__TRANSACTION.Description, CMT_REGISTER__TRANSACTION.Run, CMT_REGISTER__TRANSACTION.Sequence, CMT_REGISTER__TRANSACTION.Sequence-1 AS NewSeq,
CMT_REGISTER__TRANSACTION.Type, CMT_REGISTER__TRANSACTION.Accounting_Date, CMT_REGISTER__TRANSACTION.Reference_Date, CMT_REGISTER__TRANSACTION.Subtraction, CMM_MASTER__BANK_ACCOUNT.Description
FROM CMT_REGISTER__TRANSACTION INNER JOIN CMM_MASTER__BANK_ACCOUNT ON CMT_REGISTER__TRANSACTION.Bank_Account = CMM_MASTER__BANK_ACCOUNT.Bank_Account
where CMT_REGISTER__TRANSACTION.Batch_Source='Bank Transfers' and
cmt_register__transaction.bank_account = '{?BankFrom}' and cmt_register__transaction.accounting_date >= {?FromDate} and
cmt_register__transaction.accounting_date <= {?ToDate}
Here is the SQL statement:
SELECT CMT_REGISTER__TRANSACTION.Bank_Account, CMT_REGISTER__TRANSACTION.Description, CMT_REGISTER__TRANSACTION.Run, CMT_REGISTER__TRANSACTION.Sequence, CMT_REGISTER__TRANSACTION.Sequence-1 AS NewSeq,
CMT_REGISTER__TRANSACTION.Type, CMT_REGISTER__TRANSACTION.Accounting_Date, CMT_REGISTER__TRANSACTION.Reference_Date, CMT_REGISTER__TRANSACTION.Subtraction, CMM_MASTER__BANK_ACCOUNT.Description
FROM CMT_REGISTER__TRANSACTION INNER JOIN CMM_MASTER__BANK_ACCOUNT ON CMT_REGISTER__TRANSACTION.Bank_Account = CMM_MASTER__BANK_ACCOUNT.Bank_Account
where CMT_REGISTER__TRANSACTION.Batch_Source='Bank Transfers' and
cmt_register__transaction.bank_account = '{?BankFrom}' and cmt_register__transaction.accounting_date >= {?FromDate} and
cmt_register__transaction.accounting_date <= {?ToDate}