Percentage of Blank CPU birthdates

Declare @total as int
Declare @NotBlank as int
Declare @diff as int
Declare @Per as int

Set @total = (Select count(*) from v_LU_CPU)
Set @NotBlank = (Select count(*) from v_LU_CPU where v_LU_CPU.CPU_Birth != ”)
Set @diff = (select @total – @notblank)
Set @Per = (Select (sum((@Diff*100)/@total)))

Select
@Diff as ‘No Date’,
@NotBlank as ‘With date’,
@Total as ‘Total’,
@per as ‘Percentage blank’

Leave a Reply

Your email address will not be published. Required fields are marked *