Mahmoud offers a SQL Script for “Unposted” General Ledger Journals with Analytical Accounting Details
Dynamics GP Essentials: “Unposted” General Ledger Journals with Analytical Accounting Details –SQL Script
General Ledger & FinancialsSQL & DataDevelopment & Integration
Archived post from 2015. Dynamics GP and the links it points to have changed since; check current documentation before relying on version-specific steps.