Here is a SQL Query to export email statistics per day for last three years
USE ArchiveManager
SELECT convert(DATE, Message.MessageDate) 'Date' ,COUNT(*) 'Messages' FROM Message
JOIN MailBoxMessage on Message.MessageID = MailBoxMessage.MessageID
JOIN Mailbox on MailboxMessage.MailBoxID = Mailbox.MailboxID
JOIN [Login] on Mailbox.OwnerLoginID = [Login].LoginID
JOIN LoginDomain on Login.LoginDomainID = LoginDomain.LoginDomainID
Where [Login].LoginName = 'Administrator'
AND LoginDomain.DomainName = 'DSGSoft'
AND MessageDate > DateAdd(Year,-3,GetDate())
Group by convert(DATE, Message.MessageDate)
NOTE: Please replace the DomainName and LoginName respectively
The Query can be modified to export details for last 1 year to 1 Month
i.e:
DateAdd(Month,-1,GetDate())
© ALL RIGHTS RESERVED. Feedback Terms of Use Privacy Cookie Preference Center