I have created a UDF that uses an ODBC connection to return Sales Units based on a set of criteria: Line, Item#, BeginDate, EndDate, Price.
Currently it sums all SalesUnits within the given period based on the price. However, I would like for it to subtract SalesReturns in order to get a more accurate number and avoiding writing a new function that gets returns only (the sales one takes over an hour as is).
Code for current function:
I have tried replacing![]()
Please Login or Register to view this content.
with![]()
Please Login or Register to view this content.
and several variations of that with parentheses in different spots, but have had no luck. Can I achieve this calculation within one VBA function?![]()
Please Login or Register to view this content.
Bookmarks