So I know almost nothing about SQL and I came across a project a work. I was originally going to set up an ODBC connection from a server running my company's software to a Postgress server. Unfortunately, we have had quite a few setbacks. We wrote a php script to help us export the data that we needed from the Postgress database, and it worked the way it was supposed to. The only problem was that it takes 45 minutes for a query to run. That seems a little over the top, so we did some research and it appears that the driver we have for the database(newest one we could find), takes the entire table that we are querying and pulls it across the network to the machine that initiates the query and runs the query then. I have had a few ideas and thought maybe someone could help me fine tune them. Is it possible to run the query on the Postgress server and automate it? How about a batch file? I know that it's a little archaic, but I'm getting desperate!!!!. The query taking 45 minutes wouldn't be such a big deal, except that the data is kind of time sensitive. My company has notification software for schools and the query is for period attendance. I will be happy to supply any information requested, as long as it doesn't break my "close your mouth" contract. HELP!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!1