That kind of If statement is VBA and not valid in a query.
I also suspect you have your comparators backwards. Anything that is less than a start date is not likely to be also greater than an end date.
I expect you are looking for an Immediate If function.
IIF({condition}, {Value if true}, {Value if false})
Include the field name in each part of the condition.
IIf ([somedatefield]>[Start Date] AND [somedatefield]<[End Date], [Payment Quantity], 0 )