How many appointments yesterday?

For complex topics that regular users would not be interested in. For power users and database administrators.
Post Reply
paulgordon
Posts: 8
Joined: Tue Jun 08, 2010 1:56 pm

How many appointments yesterday?

Post by paulgordon » Thu Jun 24, 2010 9:19 am

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

paulgordon
Posts: 8
Joined: Tue Jun 08, 2010 1:56 pm

Re: How many appointments yesterday?

Post by paulgordon » Tue Jul 13, 2010 5:06 am

Solved problem. Using

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

Post Reply