Some reasons you might get "?"
1. your calculation uses ExecuteSQL and the SQL statement syntax is wrong.
2. your field is not wide enough to display the result.
What exactly is a "global error"? I'm pretty familiar with FileMakers documentation and I don't recall ever seeing this term used anywhere.
If you post some more of the details.. i.e complete definition of field Hive::HiveNumber and field Hive Count and a screenshot of the relationship settings that you leverage to do the calculation it would help.
The error is
This field comes from an unrelated table. Only global fields can be referenced in unrelated tables.
As far as SQL. I just use the calculation wizard that comes up when you click on options.
if you run SQL commands using MBS Plugin, you get back error messages.
Even without a license, the plugin should run commands and help you find the error.
Depending on your programming background, you can also use a Java IDE (no java knowledge required) and just use its data tab.
You'll get real-time help writing the SQL, and a nice interface where you can move things around vary fonts, etc. FileMaker already includes all you need to connect. There is a tiny bit of setup, but it is amazing what you get for it.
The MonkeyBread idea is good too.
There are also other SQL add-ins.
Find what works best for you. (but avoid the ever-irritating, and totally unhelpful: "?"!)
I just experienced the same issue. You need to match the calculation with the calculation output type. From your example, you are trying to output a number as text. (I had the opposite)
Change the "Calculation Result" to number, and that should solve everything.