Question: I get an error unless I remove one of the `count(distinct ...)`. Can someone tell me why and how to fix it?
I'm in vfp. `iif([condition],[if true],[else])` is equivalent to `case when`

```
SELECT * FROM dpgift where !nocalc AND rectype = "G" AND sol = "EM112" INTO CURSOR cGift
    SELECT
        list_code,
        count(distinct iif(language != 'F' AND renew = '0'  AND type =  'IN',donor,0)) as d_Count_E_New_Indiv,
        count(distinct iif(language = 'F' AND renew = '0'   AND type =  'IN',donor,0)) as d_Count_F_New_Indiv /*it works if i remove this*/
    FROM cGift gift
        LEFT JOIN
                (select didnumb, language, type from dp) d
            on cast(gift.donor as i) = cast(d.didnumb as i)
    GROUP BY list_code
    ORDER by list_code

```

edit:
apparently, you can't use multiple distinct commands on the same level. Any way around this?

Answer: 
After installing MVC4 beta today, a few of my MVC 3 projects would not compile. (ModelClientValidationRule conflict) The fix was:

Edit:

```
ProjectName.csproj

```

Change 

```
<Reference Include="System.Web.WebPages"/> 

```

To

```
<Reference Include="System.Web.WebPages, Version=1.0.0.0,
Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL "/>

```
Ok try this solution...

In the root Web.config file, add a new entry with the key webPages:Version and the value 1.0.0.0.

```
<appSettings>
<add key="webpages:Version" value="1.0.0.0"/>
<add key="webpages:Version" value="1.0.0.0"/>
<add key="ClientValidationEnabled" value="true"/>
<add key="UnobtrusiveJavaScriptEnabled" value="true"/>
</appSettings>

```

2.In Solution Explorer, right-click the project name and then select Unload Project. Then right-click the name again and select Edit ProjectName.csproj.

3.Locate the following assembly references:

```
<Reference Include="System.Web.WebPages"/>
<Reference Include="System.Web.Helpers" />

```

Replace them with the following:

```
<Reference Include="System.Web.WebPages, Version=1.0.0.0,
Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL "/>
<Reference Include="System.Web.Helpers, Version=1.0.0.0,
Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL "/>

```

4.Save the changes, close the project (.csproj) file you were editing, and then right-click the project and select Reload.

[REFERENCE](http://forums.asp.net/t/1723108.aspx/1)

also try [this](http://www.asp.net/learn/whitepapers/mvc4-release-notes#_Toc303253815)

I Found this answer [here](https://stackoverflow.com/questions/8512021/) for me the second edit combined with the first solved the problem.