How to Track unused Journal Numbers

| 02/17/2013 | 0 Comments

I got an interesting question from one of the GP users requesting a list of unused Journal Number, therefore I decided to scratch my head and write this query, below will help:

SELECT DISTINCT NUMBER FROM MASTER..spt_values WHERE NUMBER BETWEEN
(SELECT MIN(JRNENTRY) AS FROMNUMBER FROM (SELECT DISTINCT JRNENTRY FROM GL20000) AS JOURNALS)
AND
(SELECT MAX(JRNENTRY) AS TONUMBER FROM (SELECT DISTINCT JRNENTRY FROM GL20000) AS JOURNALS)
AND
number NOT IN (SELECT DISTINCT JRNENTRY FROM GL20000)

Happy tracking…!

Regards,


Mohammad R. Daoud MVP – MCT
MCP, MCBMSP, MCTS, MCBMSS
+962 – 79 – 999 65 85
me@mohdaoud.com
http://www.di.jo

See original article:
How to Track unused Journal Numbers

VA:F [1.9.22_1171]
Rating: 0.0/10 (0 votes cast)
VA:F [1.9.22_1171]
Rating: 0 (from 0 votes)

Tags: , , , , , , , , ,

Category: Blogs I Follow

About the Author ()