Hi,
I apologize for asking a question that I'm sure most of you feel is a pretty easy question, but I wasn’t able to find it on the web either.
I'm trying to calculate the Inventory$ for each day, month to date and year to date. is there a easy way for me to run this in a sql
/code
SELECT
Customers@.CLIENTNUMBER AS 'ClientNumber',
COLLCLT@.CLIENTNAME AS 'ClientName',
COUNT(Customers@.CLIENTDEBTORNUMBER) AS 'NumberAccts',
SUM(Customers@.PRINCIPALBALANCE) AS 'Inventory$',
COLLCLT@.LASTBUSDATE AS 'LastBusDate',
COLLCLT@.LASTBUSDATE AS 'LastBusDate1'
FROM Customers@
INNER JOIN COLLDEBT@ ON Customers@.MASTERACCOUNT = COLLDEBT@.RECNUM
INNER JOIN COLLCLT@ ON COLLCLT@.RECNUM = Customers@.CLIENTNUMBER
LEFT JOIN U_CLIENTLINKFIELDS@ ON U_CLIENTLINKFIELDS@.CLIENTLINK = COLLCLT@.RECNUM
WHERE
AND LastBusDate as Current > CURRENT_DATE(-1)
AND LastBusDate1 as MTD< CURRENT_DATE(-30)
AND LastBusDate1 as YTD< CURRENT_DATE(-365)
GROUP BY
ClientNumber
ORDER BY
ClientName]
code/
Thanks you - TCB
TCB
I apologize for asking a question that I'm sure most of you feel is a pretty easy question, but I wasn’t able to find it on the web either.
I'm trying to calculate the Inventory$ for each day, month to date and year to date. is there a easy way for me to run this in a sql
/code
SELECT
Customers@.CLIENTNUMBER AS 'ClientNumber',
COLLCLT@.CLIENTNAME AS 'ClientName',
COUNT(Customers@.CLIENTDEBTORNUMBER) AS 'NumberAccts',
SUM(Customers@.PRINCIPALBALANCE) AS 'Inventory$',
COLLCLT@.LASTBUSDATE AS 'LastBusDate',
COLLCLT@.LASTBUSDATE AS 'LastBusDate1'
FROM Customers@
INNER JOIN COLLDEBT@ ON Customers@.MASTERACCOUNT = COLLDEBT@.RECNUM
INNER JOIN COLLCLT@ ON COLLCLT@.RECNUM = Customers@.CLIENTNUMBER
LEFT JOIN U_CLIENTLINKFIELDS@ ON U_CLIENTLINKFIELDS@.CLIENTLINK = COLLCLT@.RECNUM
WHERE
AND LastBusDate as Current > CURRENT_DATE(-1)
AND LastBusDate1 as MTD< CURRENT_DATE(-30)
AND LastBusDate1 as YTD< CURRENT_DATE(-365)
GROUP BY
ClientNumber
ORDER BY
ClientName]
code/
Thanks you - TCB
TCB