473,320 Members | 1,854 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

iff and conditions?

Orv
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
Aug 19 '07 #1
5 2669
"Orv" <pcbidderathotmail.comwrote in
news:jt******************************@comcast.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

Aug 19 '07 #2
Orv

"Bob Quintal" <rq******@sPAmpatico.cawrote in message
news:Xn**********************@66.150.105.47...
"Orv" <pcbidderathotmail.comwrote in
news:jt******************************@comcast.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
Aug 19 '07 #3
Orv

"Orv" <pcbidderathotmail.comwrote in message
news:47******************************@comcast.com. ..
>
"Bob Quintal" <rq******@sPAmpatico.cawrote in message
news:Xn**********************@66.150.105.47...
>"Orv" <pcbidderathotmail.comwrote in
news:jt******************************@comcast.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?
Aug 20 '07 #4
"Orv" <pcbidderathotmail.comwrote in
news:u8******************************@comcast.com:
>
"Orv" <pcbidderathotmail.comwrote in message
news:47******************************@comcast.com. ..
>>
"Bob Quintal" <rq******@sPAmpatico.cawrote in message
news:Xn**********************@66.150.105.47...
>>"Orv" <pcbidderathotmail.comwrote in
news:jt******************************@comcast.co m:

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

Aug 20 '07 #5
Orv
"Bob Quintal" <rq******@sPAmpatico.cawrote in message
news:Xn**********************@66.150.105.47...
"Orv" <pcbidderathotmail.comwrote in
news:u8******************************@comcast.com:
>>
"Orv" <pcbidderathotmail.comwrote in message
news:47******************************@comcast.com ...
>>>
"Bob Quintal" <rq******@sPAmpatico.cawrote in message
news:Xn**********************@66.150.105.47...
"Orv" <pcbidderathotmail.comwrote in
news:jt******************************@comcast.c om:

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
Aug 20 '07 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: twins | last post by:
Hi, Iam wondering if there is any method to do the following: 1) When a file is created in a directory in local computer. 2) When the mysql date stored in the DB approaches the current date and...
5
by: GIMME | last post by:
One of my coworkers insists that one should never use static methods because race conditions exist. Thinking along the lines that all variable assignments are assignments to static variables. ...
1
by: Jo | last post by:
I am having a real problem with the Launch conditions in VS .NET and can only come to the conclusion that it is a bug. It states quite emphatically in the MSDN that Launch Conditions WILL be...
5
by: Uday Deo | last post by:
Hi everyone, I am looping through 4 nested loops and I would like to break in the inner most loop on certain condition and get the control on the 2 nd loop instead of 3rd loop. Here is briefly...
6
by: rshepard | last post by:
All my python books and references I find on the web have simplistic examples of the IF conditional. A few also provide examples of multiple conditions that are ANDed; e.g., if cond1: if cond2:...
2
by: Igor | last post by:
1. Are stored procedures WITH ENCRYPTION slower than the ones without encryption? 2. Should i put most restrictive conditions first or last in WHERE? In which order does MSSQL execute...
1
by: ajayvaram | last post by:
<?xml version="1.0" encoding="utf-8"?> <CategoryList> <Category ID="01" Title="One"> </Category> <Category ID="03" Title="Three"> </Category> <Category ID="04" Title="Four"> ...
1
by: mlgmlg | last post by:
Hello, I have a text box (on a Single Form) that I use to color code milestones based on a value. I use the “Conditional Formatting” tool to format four of the conditions, which works great! ...
12
by: =?ISO-8859-1?Q?Ren=E9?= | last post by:
Hi, is there a rule of thumb what is better/faster/more performant in SQL Server 2005? a) SELECT * FROM A INNER JOIN B ON B.ID = A.ID AND B.Cond1 = 1 AND B.Cond2 = 2 b) SELECT * FROM A INNER...
4
by: Prashanth Kumar B R | last post by:
Hi, I have situation in C++ where in I'll have to add around 20-25 conditions <compare a variable against a number> to an if statement. Is there any limit on the number of expressions/conditions...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.