Page 1 of 1

How many appointments yesterday?

Posted: Thu Jun 24, 2010 9:19 am
by paulgordon
Hello, we send an email to our scheduling team at 10, noon and 2 to update them on how many appointments have been made that day. Between 2 and 6 we have more appointments and will count those the next day for our daily email under how many appointments were made yesterday. I am using:

select * from securitylog
where PermType='25' and DATEDIFF( d, logdatetime, GETDATE() ) = 1

But get an error on getdate(). I have seen this in several sql statements, however do not know if it is valid in the Open Dental SQL version. CURDATE() did not work, however works on appointments for today.

Another solution is to have a user prompt for the date, helpful on Mondays as we would want datediff=2 for Saturday apts.

Thanks

Re: How many appointments yesterday?

Posted: Tue Jul 13, 2010 5:06 am
by paulgordon
Solved problem. Using

date(logdatetime) = date(curdate()-1)