Page 1 of 1

'Save Query' option

Posted: Wed Oct 31, 2007 7:15 am
by wjstarck
Hello OD friends-

It'd be nice if we could have the option to save queries of the same name and have them replace the current version.

For example, I use

SELECT referral.LName as RefLName, referral.FName as RefFName, patient.LName as PatLName, patient.FName as PatFName, patient.Gender as Sex, referral.Title as RefTitle, referral.Address as RefAddress,referral.Address2 as RefAddress2, referral.City as RefCity, referral.ST as RefST, referral.Zip as RefZip
FROM patient,referral,refattach
WHERE patient.PatNum=refattach.PatNum
AND referral.ReferralNum=refattach.ReferralNum
AND refattach.IsFrom='1'
AND refattach.RefDate >= '2007-10-01'
AND refattach.RefDate < '2007-12-31'
AND referral.NotPerson = '0'
ORDER BY RefLName, RefFName

and so I will occasionally have to go in and change refattach.RefDate to a more recent date to cut down on the size of the exported list.

Right now, I have to 'Add to Favorites' and then go in and delete the prior version. It sure would simplify things if I had a 'Save Query' button (with a popup asking if I want to replace previous version) to speed things along.

Happy Halloween!

:twisted:

Posted: Wed Oct 31, 2007 8:13 pm
by sparkly
ummm, why don't you just change the date before you 'submit query' and leave the saved/favorites query file alone?
it doesn't sound like you're using it to keep track of the last date you ran the query, and it's easier to find the 'last date run' by looking at the last file you generated...

Posted: Fri Nov 02, 2007 5:52 am
by wjstarck
Because then I have fiddle with it every time I run the query, which is multiple times throughout the day.

Besides, one should always have 'Save' and 'Save As' options. It pretty much expected behavior :P

Posted: Sun Jan 13, 2008 2:56 am
by V Suite
You can apparently edit the queries in Favorites. Double click and make changes. Then press Ok twice.

Posted: Sun Jan 13, 2008 7:21 am
by jordansparks
I know the behavior of that section is old and annoying. But it's low priority.

Posted: Sun Jan 13, 2008 10:17 am
by Jorgebon
I made a small change to your query so you don't have to go in and change the dates all the time. It will now calculate a period of time of 3 months (today minus a 3 month interval) so every day you can get the previous 3 months' referrals. I used a 3 month interval, but you can change that to whatever you want:

SELECT referral.LName as RefLName, referral.FName as RefFName, patient.LName as PatLName, patient.FName as PatFName, patient.Gender as Sex, referral.Title as RefTitle, referral.Address as RefAddress,referral.Address2 as RefAddress2, referral.City as RefCity, referral.ST as RefST, referral.Zip as RefZip
FROM patient,referral,refattach
WHERE patient.PatNum=refattach.PatNum
AND referral.ReferralNum=refattach.ReferralNum
AND refattach.IsFrom='1'
AND refattach.RefDate > curdate() - INTERVAL 3 MONTH
AND referral.NotPerson = '0'
ORDER BY RefLName, RefFName

Jorge Bonilla, DMD

Posted: Thu Jan 17, 2008 8:06 am
by wjstarck
Nice- thanks!