Fishbowl SQL Query for Inventory by Location
Fishbowl SQL query inventory by location
Also searched as
- Fishbowl tag table quantity on hand by location
- Fishbowl custom report SQL inventory
- Fishbowl query part quantity per location
- Fishbowl inventory report from database
Short answer
Fishbowl stores physical inventory as rows in the tag table, one per part per location per tracking combination. Join tag to part and location, group by part and location, and sum quantity to get on hand by location. Run it read-only through Fishbowl's reporting module or a read-only MySQL user, and verify column names against your version.
Applies to: Fishbowl Inventory with the MySQL database back end. Table and column names are stable across many releases but confirm in your version's schema before production use.
How to query inventory by location
- 1Decide where to run it: a custom report in Fishbowl's reporting module, or a read-only MySQL account connected to the Fishbowl database.
- 2Never use the main Fishbowl database login for ad hoc queries, and never run UPDATE or DELETE against inventory tables.
- 3Inspect the tag, part and location tables with DESCRIBE to confirm column names in your version.
- 4Join tag to part on the part id and to location on the location id.
- 5Group by part number and location name and sum the tag quantity.
- 6Compare the total with Fishbowl's own inventory report for a few parts to validate the query.
- 7Add filters for location group, part type or a minimum quantity as needed, and save the query for reuse.
- 8Schedule or export results rather than re-running heavy queries during busy picking hours.
How Fishbowl stores inventory
Fishbowl does not keep one quantity per part. It keeps tags: rows representing a quantity of a part in a location, with optional tracking values such as lot, serial number or revision. Summing tag quantities gives what is physically in a location. Totals per part come from summing across locations.
Fishbowl also records every movement in an inventory log, which explains how a quantity got where it is. When a tag total disagrees with a user's expectation, the log is where you find the receipt, move, pick or adjustment responsible.
The query
The example below returns on-hand quantity by part and location. Table and column names reflect common Fishbowl schemas; treat them as a starting point and confirm them with DESCRIBE in your own database before relying on results.
SELECT p.num AS part_number,
l.name AS location,
SUM(t.qty) AS on_hand
FROM tag t
JOIN part p ON p.id = t.partId
JOIN location l ON l.id = t.locationId
GROUP BY p.num, l.name
HAVING SUM(t.qty) <> 0
ORDER BY p.num, l.name;Validating and extending it
Pick three parts and compare your result with Fishbowl's inventory quantity report. If they differ, check whether your query includes locations that Fishbowl treats differently, such as shipping, receiving or non-available locations, and whether committed quantity matters to the report you are matching.
To extend it, join the location group table to filter to pickable locations, add part type to separate stock from non-inventory items, or join recent inventory log rows to show the last movement date per location. Keep each addition tested against a known part.
Safety and performance
Use a read-only database account, run on a copy or during quiet hours for large queries, and avoid selecting every column from large tables. Fishbowl's database is the live system of record; a long-running or locking query can slow warehouse operations.
Do not write to inventory tables directly. Fishbowl maintains quantities, costs and the accounting link through its own logic, and direct edits can produce stock that does not reconcile with the general ledger. Use inventory adjustment, move and cycle count features instead.
Common pitfalls
- !Writing to the tag table or inventory log directly, which bypasses costing and accounting logic.
- !Assuming column names without running DESCRIBE on your version.
- !Using the application login for ad hoc queries instead of a read-only account.
- !Forgetting that tracking values create several tag rows per part and location, then reading rows as duplicates.
- !Comparing a physical on-hand total to a report that excludes certain location types.
How an ERP-grounded AI assistant handles this
A grounded assistant such as DataRay or ERPray can take a plain-language question about stock by location, generate the SQL against a read-only connection, show the query it ran and return the table, so users do not need to remember schema names. It does not write to the database. For a one-off known report, Fishbowl's built-in reports or a saved custom report may be all you need.
Frequently asked questions
Which Fishbowl table holds quantity on hand?
Physical quantities live in the tag table, with one row per part, location and tracking combination. Summing tag quantity by part and location gives on hand. Confirm column names in your version with DESCRIBE before using the query in production.
Can I run SQL directly against Fishbowl?
Yes, Fishbowl uses MySQL, and many customers run read-only queries or custom reports. Use a read-only account, avoid writes to inventory tables and run heavy queries off-hours so you do not slow warehouse operations.
Why does my SQL total differ from the Fishbowl report?
Fishbowl reports may exclude certain location types, include committed or allocated quantities differently, or filter by part type. Align the filters first, then compare a few parts and check the inventory log for recent movements.
Is it safe to adjust quantities with an UPDATE statement?
No. Fishbowl links inventory to costing and accounting through its own logic, so direct edits can leave stock that does not reconcile. Use inventory adjustments, moves or cycle counts inside Fishbowl instead.
Related
Fix Fishbowl Error: MySQL Server Has Gone Away
This error means the Fishbowl Server lost its connection to the underlying MySQL database, usually because a session sat idle past MySQL's wait_timeout, MySQL itself restarted, or a large import or report exceeded max_allowed_packet. Raise the relevant MySQL timeout and packet settings, confirm the MySQL service is actually running, and restart both MySQL and the Fishbowl Server service.
Error fixFix Fishbowl REST API Login 401 and Integrated App Errors
A failed Fishbowl REST API login is usually one of three things: the integration was never approved inside Fishbowl, the appName and appId in the request do not match the approved entry, or the Fishbowl user lacks permission. Approve the app in the Fishbowl client, fix the login payload, use a dedicated API user and send the returned token on later calls.
How-toKatana Manufacturing Order Ingredients Not Available: How to Resolve
A Katana manufacturing order flags an ingredient as not available when free stock at the order's location is less than the recipe quantity and no incoming purchase or manufacturing order covers the gap. Resolve it by checking the ingredient's stock by location, creating or expediting a purchase order, fixing a wrong location or recipe, or correcting stock with an adjustment or stocktake.
How-toHow to Create a Generic Inquiry in Acumatica
Generic Inquiries (GI) are Acumatica's no-code query builder for joining tables, adding filters, and exposing the result as an inquiry screen, dashboard data source, or API endpoint. Open System > Customization > Generic Inquiry, add your base table, define joins and conditions, then run and save. No SQL or customization project is required.
Error fixFix Odoo AccessError: You Are Not Allowed to Access Records
Odoo raises AccessError when a user's security groups do not grant a CRUD right on a model through ir.model.access.csv, or when an ir.rule record rule filters the specific record out for that user or company. Fix it by adding the user to the group named in the error, editing the model's access rights, or reviewing the record rule's domain under Settings > Technical > Security.
How-toHow to Void a Check in Sage 100
Sage 100 voids checks through Accounts Payable > Main > Check and Payment Voiding. Select the bank code, choose the check number, and Sage reverses the Cash Disbursements Journal entry and reopens the invoice it paid. A check that already cleared in Bank Reconciliation or falls in a closed period needs an extra step before it can be voided cleanly.
AI for ERPAI Demand Forecasting for Manufacturers: Better Numbers and an Explanation Planners Can Trust
AI demand forecasting explains ERP forecast changes in plain language, flags exceptions for planners, and handles short-history SKUs without Excel overrides.
AI for ERPAI for quote-to-cash in manufacturing and job shop ERPs
AI reads incoming RFQs, drafts quotes from your ERP's own cost and pricing history, and flags parts your shop has never quoted before, keeping the estimator in control.
Stuck on Fishbowl Inventory?
Talk to engineers who work inside Fishbowl Inventory every week, and who build private AI that answers these questions from your own ERP data.