Can I query Microsoft GP database and save the result as MDF file?
The way to handle this is to create a new database with a different name (for example, MyDB_Export), then use the Export functionality in Sql Server Management Studio - right-click on the database in SSMS, and click Tasks / Export Data... on the pop-up menus. The only thing you will do is to specify a query to select the data to export to the new DB.

Its pretty intuitive to walk through the steps, so you should be able to work out how to complete this easily once you are in the Import/Export Wizard. If not, just add a comment below and I'll expand on this.