Harald's correct, you can use MS Query to execute SQL commands that bring
data from databases into Excel. The actual menu items differ according to
which version of Excel you have, but the capability goes back to Excel 97.
You do need to have installed MS Query at the time you installed Excel.
MS Query lets you select database fields and some simple table links, and
offers a very basic way to specify record selection criteria. If you need
something more sophisticated, build your query or stored procedure in your
DBMS and point MS Query at that.
BTW, your question isn't off-topic. There's another newsgroup,
microsoft.public.excel.querydao, which might have focused on your question,
but the ng gets very little traffic. Why microsoft.public.excel.queryado
[sic] hasn't been set up is a mystery to me.