cancel
Showing results for 
Search instead for 
Did you mean: 

SQL Query: Number of items in Vault Store not on legal hold by year.

Hi all,

Today I am trying to work on selecting the number of savesets in a Vault store database grouped by year.

Has anyone done this before or have any pointers on it?

Thanks,

Jeremy.

1 Solution

Accepted Solutions
Accepted Solution!

This should help: select

This should help:

 

select year(s.ArchivedDate) as 'year',
    COUNT(s.SavesetIdentity) 
from saveset s    
where s.SavesetIdentity not in (select SavesetIdentity from HoldSaveset where holdsaveset.savesetidentity = s.SavesetIdentity)
group by year(s.ArchivedDate)

Working for cloudficient.com

View solution in original post

6 Replies
Accepted Solution!

This should help: select

This should help:

 

select year(s.ArchivedDate) as 'year',
    COUNT(s.SavesetIdentity) 
from saveset s    
where s.SavesetIdentity not in (select SavesetIdentity from HoldSaveset where holdsaveset.savesetidentity = s.SavesetIdentity)
group by year(s.ArchivedDate)

Working for cloudficient.com

View solution in original post

Great thank you. I was off in

Great thank you. I was off in a different direction using views.

Does the same query for those

Does the same query for those on legal hold look like this?

select year(s.ArchivedDate) as 'year',
    COUNT(s.SavesetIdentity) 
from saveset s    
where s.SavesetIdentity in (select SavesetIdentity from HoldSaveset where holdsaveset.savesetidentity = s.SavesetIdentity)
group by year(s.ArchivedDate)

Looks right, yep.

Looks right, yep.

Working for cloudficient.com

Great thanks very much!

Great thanks very much!

Just one thing.  Do not tell

Just one thing.  Do not tell anyone I helped you with SQL ...  I tell everone I know nothing about it ..  It makes life more peaceful.   Ooopps I just posted it on the interwebz :)

 

Working for cloudficient.com