When I run SQLplus from Toad for Oracle's editor, I get an Ora-28040 error. I do not get the error when running the statement in the editor.
There is a problem with your SQLplus.
If you have another Oracle client that includes SQLplus, that you are able to launch standalone and run the query in with no problem, select View | Toad Options | Executables in Toad's menu bar and put the path to the SQLplus file that works correctly in the SQL*plus field.
If you do not have another Oracle client installed, you will need to install a new client that includes SQLplus and follow the steps above for adding the path to the new SQLplus file in Toad.