Rabu, 19 November 2014

Re: [MS_AccessPros] Dcount Function

 

Dcount is not necessary.   Try 

Expr1: IIf([med1]=4,1,0)+IIf([med2]=4,1,0)+IIf([med3]=4,1,0)+IIf([med4]=4,1,0)+IIf([med5]=4,1,0)+IIf([med6]=4,1,0)

Stuart


On Tuesday, November 18, 2014 3:44 PM, "Adeboyejo Oyenuga aoye_99@yahoo.co.uk [MS_Access_Professionals]" <MS_Access_Professionals@yahoogroups.com> wrote:


 
I need help with my query. I will simplify the table called 'Test' its based on as follows. Med1 through Med6 being fields.


Record No     Med1   Med2  Med3   Med4  Med5   Med6
001                      2          2          4          3           3          5
002                      3          3          3          4           4          4     

When I tried to create a calculated control to return the count of 4 in each row, I got 3 for record 1 and 3 for record 2 . The correct answer is 1 for record 1 and 3 for record 2.

The expression I used is shown below. Please assist as I do not know what I am doing wrong.

Expr1: DCount("[Median5]","Test","[Median5] = '4'")+DCount("[Median4]","Test","[Median4]='4'")+DCount("[Median6]","Test","[Median6]='4'")
 

Thanks

Ade


__._,_.___

Posted by: Stuart Schulman <stoughy@yahoo.com>
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (6)

.

__,_._,___

Tidak ada komentar:

Posting Komentar