There's any number of programming languages you could use for that.
From the sounds of it, you're querying a database. Depending on the server platform, you could use several languages. If you're running MS SQL server, Visual Basic might be your best choice. For Linux, running pretty much any database backend, you might be better off learning Perl, Python, or maybe even PHP. All three of those languages have superb text processing capabilities. I'm not too sure about VB, but I'd be surprised if its capabilities in that realm were limited. Of course, all of these languages would probably require a knowledge of SQL queries, too.
I'm not a big programmer, but I'd like to think I can conceptualize pretty well. If you're wanting to do something quickly, and you need it to be pointy-clicky, you might want to look at VB, or even VBA (visual basic for applications) if you want to integrate it into Excel. When you're working with Microsoft products, one strenght that they have is that they make EVERYTHING of their talk to everything else they have-- I wouldn't be surprised if you could export your Microsoft flight simulator itinerary into Excel, or plan out your Age of Empires attack plan using PowerPoint!
But again, it really depends on what your setup is like. That should determine how to proceed. From there, if you need to evaluate your options, pick the language you're most familiar with. If your familiarity level with the options is low, then it becomes a matter of looking at each, and deciding which one either interests you more, or which one looks easiest to learn.