dbTalk Databases Forums  

iff and conditions?

comp.database.ms-access comp.database.ms-access


Discuss iff and conditions? in the comp.database.ms-access forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Bob Quintal
 
Posts: n/a

Default Re: iff and conditions? - 08-19-2007 , 07:58 AM






"Orv" <pcbidderathotmail.com> wrote in
news:jtudnU_ILrHnrFXbnZ2dnUVZ_h-vnZ2d (AT) comcast (DOT) com:

Quote:
I have a report where I am trying to return the number of
females and males above or below a certain age. I have no
prolem with getting totals for males and females.

I have an unbound text box woth the foloowing source:

=Count(IIf([Age]>="18",0) And ([Sex]="Female",0))

This returns an error.

Any ides???
Thx,
-Orv

=sum(IIF([age] >="18" AND [SEX]="Female",1,0))

Did you define age as a text type? If it's a number, delete the
quotes around the 18.

--
Bob Quintal

PA is y I've altered my email address.

--
Posted via a free Usenet account from http://www.teranews.com



Reply With Quote
  #2  
Old   
Orv
 
Posts: n/a

Default iff and conditions? - 08-19-2007 , 08:03 AM






I have a report where I am trying to return the number of females and males
above or below a certain age. I have no prolem with getting totals for males
and females.

I have an unbound text box woth the foloowing source:

=Count(IIf([Age]>="18",0) And ([Sex]="Female",0))

This returns an error.

Any ides???
Thx,
-Orv



Reply With Quote
  #3  
Old   
Orv
 
Posts: n/a

Default Re: iff and conditions? - 08-19-2007 , 08:58 AM




"Bob Quintal" <rquintal (AT) sPAmpatico (DOT) ca> wrote

Quote:
"Orv" <pcbidderathotmail.com> wrote in
news:jtudnU_ILrHnrFXbnZ2dnUVZ_h-vnZ2d (AT) comcast (DOT) com:

I have a report where I am trying to return the number of
females and males above or below a certain age. I have no
prolem with getting totals for males and females.

I have an unbound text box woth the foloowing source:

=Count(IIf([Age]>="18",0) And ([Sex]="Female",0))
This returns an error.

Any ides???
Thx,
-Orv

=sum(IIF([age] >="18" AND [SEX]="Female",1,0))

Did you define age as a text type? If it's a number, delete the
quotes around the 18.

--
Bob Quintal

PA is y I've altered my email address.

--
Posted via a free Usenet account from http://www.teranews.com

Thanks. I think I got it

=Count(IIf([Sex]="Female" And ([Age])>="18",0))

Orv




Reply With Quote
  #4  
Old   
Orv
 
Posts: n/a

Default Re: iff and conditions? - 08-19-2007 , 08:31 PM




"Orv" <pcbidderathotmail.com> wrote

Quote:
"Bob Quintal" <rquintal (AT) sPAmpatico (DOT) ca> wrote in message
news:Xns999159CBAFA42BQuintal (AT) 66 (DOT) 150.105.47...
"Orv" <pcbidderathotmail.com> wrote in
news:jtudnU_ILrHnrFXbnZ2dnUVZ_h-vnZ2d (AT) comcast (DOT) com:

I have a report where I am trying to return the number of
females and males above or below a certain age. I have no
prolem with getting totals for males and females.

I have an unbound text box woth the foloowing source:

=Count(IIf([Age]>="18",0) And ([Sex]="Female",0))
This returns an error.

Any ides???
Thx,
-Orv

=sum(IIF([age] >="18" AND [SEX]="Female",1,0))

Did you define age as a text type? If it's a number, delete the
quotes around the 18.

--
Bob Quintal

PA is y I've altered my email address.

--
Posted via a free Usenet account from http://www.teranews.com

Thanks. I think I got it

=Count(IIf([Sex]="Female" And ([Age])>="18",0))

Orv
OK,
Now that I got it to return all the females older than 18. Can I
throw an "And" in the iff statement to only return a certain race? like
this:

=Count(IIf([Sex]="Female" And ([Age])>="18",0 And ([Race])="White"))

or do I need a different expression altogether?




Reply With Quote
  #5  
Old   
Bob Quintal
 
Posts: n/a

Default Re: iff and conditions? - 08-19-2007 , 08:47 PM



"Orv" <pcbidderathotmail.com> wrote in
news:u8KdnaWhRrtDfVXbnZ2dnUVZ_gKdnZ2d (AT) comcast (DOT) com:

Quote:
"Orv" <pcbidderathotmail.com> wrote in message
news:47WdnRmtfvLoo1XbnZ2dnUVZ_vihnZ2d (AT) comcast (DOT) com...

"Bob Quintal" <rquintal (AT) sPAmpatico (DOT) ca> wrote in message
news:Xns999159CBAFA42BQuintal (AT) 66 (DOT) 150.105.47...
"Orv" <pcbidderathotmail.com> wrote in
news:jtudnU_ILrHnrFXbnZ2dnUVZ_h-vnZ2d (AT) comcast (DOT) com:

I have a report where I am trying to return the number of
females and males above or below a certain age. I have no
prolem with getting totals for males and females.

I have an unbound text box woth the foloowing source:

=Count(IIf([Age]>="18",0) And ([Sex]="Female",0))
This returns an error.

Any ides???
Thx,
-Orv

=sum(IIF([age] >="18" AND [SEX]="Female",1,0))

Did you define age as a text type? If it's a number, delete the
quotes around the 18.

--
Bob Quintal

PA is y I've altered my email address.

--
Posted via a free Usenet account from http://www.teranews.com

Thanks. I think I got it

=Count(IIf([Sex]="Female" And ([Age])>="18",0))

Orv

OK,
Now that I got it to return all the females older than
18. Can I
throw an "And" in the iff statement to only return a certain
race? like this:

=Count(IIf([Sex]="Female" And ([Age])>="18",0 And
([Race])="White"))

or do I need a different expression altogether?

Not quite.
=Count(IIf([Sex]="Female" And ([Age])>="18" And
([Race])="White",0 ))




--
Bob Quintal

PA is y I've altered my email address.

--
Posted via a free Usenet account from http://www.teranews.com



Reply With Quote
  #6  
Old   
Orv
 
Posts: n/a

Default Re: iff and conditions? - 08-20-2007 , 06:18 AM



"Bob Quintal" <rquintal (AT) sPAmpatico (DOT) ca> wrote

Quote:
"Orv" <pcbidderathotmail.com> wrote in
news:u8KdnaWhRrtDfVXbnZ2dnUVZ_gKdnZ2d (AT) comcast (DOT) com:


"Orv" <pcbidderathotmail.com> wrote in message
news:47WdnRmtfvLoo1XbnZ2dnUVZ_vihnZ2d (AT) comcast (DOT) com...

"Bob Quintal" <rquintal (AT) sPAmpatico (DOT) ca> wrote in message
news:Xns999159CBAFA42BQuintal (AT) 66 (DOT) 150.105.47...
"Orv" <pcbidderathotmail.com> wrote in
news:jtudnU_ILrHnrFXbnZ2dnUVZ_h-vnZ2d (AT) comcast (DOT) com:

I have a report where I am trying to return the number of
females and males above or below a certain age. I have no
prolem with getting totals for males and females.

I have an unbound text box woth the foloowing source:

=Count(IIf([Age]>="18",0) And ([Sex]="Female",0))
This returns an error.

Any ides???
Thx,
-Orv

=sum(IIF([age] >="18" AND [SEX]="Female",1,0))

Did you define age as a text type? If it's a number, delete the
quotes around the 18.

--
Bob Quintal

PA is y I've altered my email address.

--
Posted via a free Usenet account from http://www.teranews.com

Thanks. I think I got it

=Count(IIf([Sex]="Female" And ([Age])>="18",0))

Orv

OK,
Now that I got it to return all the females older than
18. Can I
throw an "And" in the iff statement to only return a certain
race? like this:

=Count(IIf([Sex]="Female" And ([Age])>="18",0 And
([Race])="White"))

or do I need a different expression altogether?

Not quite.
=Count(IIf([Sex]="Female" And ([Age])>="18" And
([Race])="White",0 ))





--
Bob Quintal

PA is y I've altered my email address.

--
Posted via a free Usenet account from http://www.teranews.com

Worked like a charm, thanks.
-Orv




Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.