Have you every been annoyed by creating a query in PIA, using PSQuery? The easier way to do it is to create a new record, turn that into a view, and then query the record in PSQuery. Instructions are below.
PSQuery – View
Open up app designer and create a new record.
Insert at least one record field, and hit save. (make sure the number of records match the number of columns in your select statement)
Then under record type, select SQL view.
Then input your SQL code under the SQL editor section. (make sure not to have a semicolon at the end of your query)
Make a primary key. (double click > and select key, search key, and list box item)
Then go to build > current definition.
Select “Create views” and then select “Execute SQL now”.
Then hit Build.
Then add the record to the query access manager tree in PIA.
Then you can select from the record/view in PSQuery.
Hope that helps!