Need more, need help now?
- - - - - - - - - - - - - - - - - - pay-as-you-go support - no contract - tenth of an hour billing - expert help - fast service - no call queues
Need integration?
- - - - - - - - - - - - - - - - - - with your shipping system - website - invoicing system - crm - cms - manufacturing - order import - back to back orders..
Need a report?
- - - - - - - - - - - - - - - - - - Excel reporting that pulls data from Sage - custom layouts - layouts that change adapt to your brands and/or for drop shipping.
Want web hosting?
- - - - - - - - - - - - - - - - - - Your own domain name - email - a shop - wordpress - woo commerce - ticket systems - help desks - forums - portals

ODBC Aged Creditors Query

Sage 50 general help forum - Free help and support for all general issues
Post Reply
ODBCWanKenobi
User
User
Posts: 2
Joined: 28 Oct 2016, 15:22
Sage Version: v2016 22 UK/Europe/Africa

ODBC Aged Creditors Query

Post by ODBCWanKenobi » 28 Oct 2016, 15:32

Hi All
I'm producing a workbook that sucks up all sorts of data from sage. TB, Projects, Nom ledger, etc all working well. I have written code to get the aged debtors & creditors listings but they includes future payments. Can anyone help with the code that would be required which would exclude future payments.

Aged Creditors Code as it stands...

Code: Select all

SELECT 
purchase_LEDGER.ACCOUNT_REF AS 'Account', 
purchase_LEDGER.NAME AS 'Supplier Name', 
Sum(AUDIT_HEADER.AGED_BALANCE) AS 'Balance', 
Sum(AUDIT_HEADER.AGED_FUTURE) AS 'Future', 
Sum(AUDIT_HEADER.AGED_30) AS '30', 
Sum(AUDIT_HEADER.AGED_60) AS '60', 
Sum(AUDIT_HEADER.AGED_90) AS '90', 
Sum(AUDIT_HEADER.AGED_OLDER) AS 'Older'
FROM AUDIT_HEADER AUDIT_HEADER, purchase_LEDGER purchase_LEDGER
WHERE 
purchase_LEDGER.ACCOUNT_REF = AUDIT_HEADER.ACCOUNT_REF AND ((AUDIT_HEADER.AGED_BALANCE<>0) AND (AUDIT_HEADER.DELETED_FLAG<>1) AND (AUDIT_HEADER.DATE<=?))
GROUP BY purchase_LEDGER.ACCOUNT_REF, purchase_LEDGER.NAME
Many thanks in advance
Sage 22.1.10.394 SP5
Excel 2013 32 bit
Win 10 64 bit

ODBCWanKenobi
User
User
Posts: 2
Joined: 28 Oct 2016, 15:22
Sage Version: v2016 22 UK/Europe/Africa

Re: ODBC Aged Creditors Query

Post by ODBCWanKenobi » 31 Oct 2016, 15:38

Well, after speaking with sage support this morning it would appear that what I want to do is just not possible. My requirement would mean accessing the AUDIT_USAGE table which is not accessible via ODBC. Try to connect to it in MS Query and MS Query crashes out. I have tried this on 2 machines and got consistent results. THe guy I spoke to at sage said they themselves tried this in 2007 when Excel got 1m rows for the first time, and it just isnt possible. Bit of a disappointing answer for something as simple as an aged report but I wasn't left in any doubt.

User avatar
brucedenney
Site Admin
Site Admin
Posts: 4672
Joined: 28 Feb 2006, 09:56
Sage Version: v30 UK/Europe/Africa

Re: ODBC Aged Creditors Query

Post by brucedenney » 31 Oct 2016, 16:35

The way to do it, is to run 2 reports.

In the first extract it "all".

In the second just get the "future" dated receipts/payments

take the "future" payments off the "all" value you have the result you want?
For just about anything Sage :- Discount subscriptions, pay-as-you-go support, application integration, reports, layouts, linked excel spreadsheets, analysis or any other help making life with sage easier/less time consuming Contact me.

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests