Probelm with sql script

For users or potential users.
Post Reply
brentwood
Posts: 144
Joined: Tue Feb 05, 2008 4:04 pm

Probelm with sql script

Post by brentwood » Sat Dec 18, 2010 10:04 am

I have been using a sql script to for list of outstanding payments. I just updated to 7.4.16. Now the result shows System.Byte[] for "last statement date" and "due date". I check the data of "DateSent" in "statement" table. It seems O.K. to me. Does anyone know what is going on? Thanks.

SELECT CONCAT(pat.LName, ', ', pat.FName) AS "Patient",
DATE_FORMAT(MAX(s.DateSent),'%m/%d/%Y') AS "Last Stmt Date",
DATE_FORMAT(DATE(ADDDATE(MAX(DATE(s.DateSent)), INTERVAL 365 DAY)),'%m/%d/%Y') AS "Due Date",
pat.estbalance /* patient estimate balance not the whole family */
FROM patient pat, statement s
WHERE s.PatNum = pat.PatNum AND DATE(s.DateSent) > DATE(ADDDATE(CURDATE(), INTERVAL -365 DAY))
AND s.Mode_ = 0 /*mail*/
and pat.estbalance > 5 /* this is patient balance not family */
GROUP BY pat.PatNum
ORDER BY MAX(DATE(s.datesent)) DESC, "Patient";

User avatar
wjstarck
Posts: 936
Joined: Tue Jul 31, 2007 7:18 am
Location: Keller, TX
Contact:

Re: Probelm with sql script

Post by wjstarck » Sat Dec 18, 2010 11:36 am

Have a look at this thread:

viewtopic.php?f=1&t=3149
Cheers,

Bill Starck, DDS
Big Idea Software, LLC
Developer, EASy(Electronic Anesthesia System) for Open Dental
817-807-1709
TX, USA

Post Reply