I am attempting to add another SETRANGE parameter when data is pulled from the Customer Equipment (custom) table.
CustEquip is set as a record under Global Variables for that table. 'New' is one of the options you can choose when entering data into the "Asset Status" field. I have several records that already exist with this value and simply want it to only take values of 'New' and ignore values of 'Deactivated'. The rest of the code works perfectly and I only get the error below when I add in the Bold line.
Any help would be greatly appreciated.

MajortotalQty := 0;
MinorQty := 0;
CustEquip.RESET;
CustEquip.SETRANGE("Customer No.","Sales Header"."Sell-to Customer No.");
CustEquip.SETRANGE(Type,1);
CustEquip.SETRANGE("Item No.",'Q1002');
//custequip.setrange(Quantity,0);
IF CustEquip.FIND('-') THEN
MinorQty := CustEquip.COUNT;
CustEquip.RESET;
CustEquip.SETRANGE("Customer No.","Sales Header"."Sell-to Customer No.");
CustEquip.SETRANGE(Type,0);
CustEquip.SETRANGE("Item No.",'Q1002');
CustEquip.SETRANGE("Asset Status", 'New');
IF CustEquip.FIND('-') THEN
REPEAT
CustEquip.CALCFIELDS(Quantity);
MajortotalQty := MajortotalQty + CustEquip.Quantity;
UNTIL CustEquip.NEXT = 0;
Error
Type conversion is not possible because 1 of the operators contains an invalid type.
Option := Text
Comments
RIS Plus, LLC
That worked perfectly.
Thank you.
RIS Plus, LLC