Export data to Excel

Just write your own query within the function and call the function from anywhere in your script