G
Guest
I'm trying to write a simple pass through query to return a filtered
selection of transaction data from a SQL Server database. In one field
(works_order) I need to return a particular result if the transaction type is
"COMP" and a different result in all other cases. I have written the
following SQL query:
SELECT (IIf((transaction_type) =
'COMP',Left(lot_number,6),Left(movement_reference,6))) AS works_order, dated,
movement_reference, transaction_type, lot_number, movement_quantity,
movement_cost, total_labour_cost
FROM scheme.stkhstm
WHERE (((dated) >('1/1/2005')) AND ((transaction_type)='W/O' Or
(transaction_type)='DKIT' Or (transaction_type)='COMP'));
The dependent field is the first one: (IIf(transaction_type ... AS
works_order,
I can't get this to work though. I'm a complete novice at pass through
queries, so I'm sure I must have the syntax wrong. Can anyone see what I'm
Doing wrong here?
Thanks in advance
Vaughan
selection of transaction data from a SQL Server database. In one field
(works_order) I need to return a particular result if the transaction type is
"COMP" and a different result in all other cases. I have written the
following SQL query:
SELECT (IIf((transaction_type) =
'COMP',Left(lot_number,6),Left(movement_reference,6))) AS works_order, dated,
movement_reference, transaction_type, lot_number, movement_quantity,
movement_cost, total_labour_cost
FROM scheme.stkhstm
WHERE (((dated) >('1/1/2005')) AND ((transaction_type)='W/O' Or
(transaction_type)='DKIT' Or (transaction_type)='COMP'));
The dependent field is the first one: (IIf(transaction_type ... AS
works_order,
I can't get this to work though. I'm a complete novice at pass through
queries, so I'm sure I must have the syntax wrong. Can anyone see what I'm
Doing wrong here?
Thanks in advance
Vaughan