EXPRESSIONS

M

MDI Anne

In my query I get several values for my EVENT_CODE field. I am only looking
to find the "R" code and the null codes. For the "R" codes I would like to
show a "Y" for yes, and for the null codes I would like to show a "N" for no.
Right now I have this in 2 different columns, but would if possible, like to
have this in 1 column.

Am I remotely close with my expressions? and How do I do this in 1 column?

Expr1: IIf([EVENT_CODE]="R","Y")
Expr2: IIf(Len([EVENT_CODE] & "")=0,"N")

Thanks for any help!
 
F

fredg

In my query I get several values for my EVENT_CODE field. I am only looking
to find the "R" code and the null codes. For the "R" codes I would like to
show a "Y" for yes, and for the null codes I would like to show a "N" for no.
Right now I have this in 2 different columns, but would if possible, like to
have this in 1 column.

Am I remotely close with my expressions? and How do I do this in 1 column?

Expr1: IIf([EVENT_CODE]="R","Y")
Expr2: IIf(Len([EVENT_CODE] & "")=0,"N")

Thanks for any help!

Exp:IIf(IsNull([Event_code]),"N",IIf([Event_Code]="R","Y",""))
 
M

MDI Anne

Excellent! Worked like a charm! Thank you so much!

fredg said:
In my query I get several values for my EVENT_CODE field. I am only looking
to find the "R" code and the null codes. For the "R" codes I would like to
show a "Y" for yes, and for the null codes I would like to show a "N" for no.
Right now I have this in 2 different columns, but would if possible, like to
have this in 1 column.

Am I remotely close with my expressions? and How do I do this in 1 column?

Expr1: IIf([EVENT_CODE]="R","Y")
Expr2: IIf(Len([EVENT_CODE] & "")=0,"N")

Thanks for any help!

Exp:IIf(IsNull([Event_code]),"N",IIf([Event_Code]="R","Y",""))
 
M

MDI Anne

Fredg,

As in my previous post, this works excellent! My next question is, how can
I ONLY return those lines with an "R" or Null value?

Again, Thank you for any help.

As you can probably tell, I'm pretty new to Access...and am anxious to learn
as much as I can.

fredg said:
In my query I get several values for my EVENT_CODE field. I am only looking
to find the "R" code and the null codes. For the "R" codes I would like to
show a "Y" for yes, and for the null codes I would like to show a "N" for no.
Right now I have this in 2 different columns, but would if possible, like to
have this in 1 column.

Am I remotely close with my expressions? and How do I do this in 1 column?

Expr1: IIf([EVENT_CODE]="R","Y")
Expr2: IIf(Len([EVENT_CODE] & "")=0,"N")

Thanks for any help!

Exp:IIf(IsNull([Event_code]),"N",IIf([Event_Code]="R","Y",""))
 
F

fredg

Fredg,

As in my previous post, this works excellent! My next question is, how can
I ONLY return those lines with an "R" or Null value?

Again, Thank you for any help.

As you can probably tell, I'm pretty new to Access...and am anxious to learn
as much as I can.

fredg said:
In my query I get several values for my EVENT_CODE field. I am only looking
to find the "R" code and the null codes. For the "R" codes I would like to
show a "Y" for yes, and for the null codes I would like to show a "N" for no.
Right now I have this in 2 different columns, but would if possible, like to
have this in 1 column.

Am I remotely close with my expressions? and How do I do this in 1 column?

Expr1: IIf([EVENT_CODE]="R","Y")
Expr2: IIf(Len([EVENT_CODE] & "")=0,"N")

Thanks for any help!

Exp:IIf(IsNull([Event_code]),"N",IIf([Event_Code]="R","Y",""))

You mean filter the records?

As criteria in the [Event_code] column, write
Is Null
On the line beneath that, write:
= "R"
 
M

MDI Anne

Ok, that works, except now I'm prompted for dates, and I enter 7/1/05 and
7/31/05, and the results are showing me all dates, even ones that are not
within my date range. Am I doing something wrong?

fredg said:
Fredg,

As in my previous post, this works excellent! My next question is, how can
I ONLY return those lines with an "R" or Null value?

Again, Thank you for any help.

As you can probably tell, I'm pretty new to Access...and am anxious to learn
as much as I can.

fredg said:
On Fri, 26 Aug 2005 10:45:01 -0700, MDI Anne wrote:

In my query I get several values for my EVENT_CODE field. I am only looking
to find the "R" code and the null codes. For the "R" codes I would like to
show a "Y" for yes, and for the null codes I would like to show a "N" for no.
Right now I have this in 2 different columns, but would if possible, like to
have this in 1 column.

Am I remotely close with my expressions? and How do I do this in 1 column?

Expr1: IIf([EVENT_CODE]="R","Y")
Expr2: IIf(Len([EVENT_CODE] & "")=0,"N")

Thanks for any help!

Exp:IIf(IsNull([Event_code]),"N",IIf([Event_Code]="R","Y",""))

You mean filter the records?

As criteria in the [Event_code] column, write
Is Null
On the line beneath that, write:
= "R"
 
F

fredg

Ok, that works, except now I'm prompted for dates, and I enter 7/1/05 and
7/31/05, and the results are showing me all dates, even ones that are not
within my date range. Am I doing something wrong?

fredg said:
Fredg,

As in my previous post, this works excellent! My next question is, how can
I ONLY return those lines with an "R" or Null value?

Again, Thank you for any help.

As you can probably tell, I'm pretty new to Access...and am anxious to learn
as much as I can.

:

On Fri, 26 Aug 2005 10:45:01 -0700, MDI Anne wrote:

In my query I get several values for my EVENT_CODE field. I am only looking
to find the "R" code and the null codes. For the "R" codes I would like to
show a "Y" for yes, and for the null codes I would like to show a "N" for no.
Right now I have this in 2 different columns, but would if possible, like to
have this in 1 column.

Am I remotely close with my expressions? and How do I do this in 1 column?

Expr1: IIf([EVENT_CODE]="R","Y")
Expr2: IIf(Len([EVENT_CODE] & "")=0,"N")

Thanks for any help!

Exp:IIf(IsNull([Event_code]),"N",IIf([Event_Code]="R","Y",""))

You mean filter the records?

As criteria in the [Event_code] column, write
Is Null
On the line beneath that, write:
= "R"

I haven't a clue.
Is there a Date field in the query?
If so, is there criteria also on the date field?
Are you sure the parameter prompts are from the query, and not from an
associated report?

I would suggest you post the entire query SQL, with a very brief
description of the result you expect.
 
M

MDI Anne

What I'm looking for is 4 columns. 1. Filing #, 2. Final Action Date, 3.
Received Date, 4. Problem (Y/N), where I'm able to be prompted for a
specific date range (ie 5/1/05 to 5/31/05)

Here is my SQL as requested:

SELECT MO_DOI_LAH_LEAD_FILINGS.FILING_NO,
MO_DOI_LAH_LEAD_FILINGS.FINAL_ACTION_DATE,
MO_DOI_LAH_LEAD_FILINGS.RECEIVED_DATE, MO_DOI_LAH_EVENTS.EVENT_CODE,
IIf(IsNull([Event_code]),"N",IIf([Event_Code]="R","Y","")) AS Exp
FROM (MO_DOI_LAH_LEAD_FILINGS LEFT JOIN MO_DOI_LAH_EVENTS ON
MO_DOI_LAH_LEAD_FILINGS.EID = MO_DOI_LAH_EVENTS.LAH_FILING_EID) INNER JOIN
MO_DOI_IDENTIFIERS ON MO_DOI_LAH_LEAD_FILINGS.ANALYST_EID =
MO_DOI_IDENTIFIERS.OWNER_EID
WHERE (((MO_DOI_LAH_LEAD_FILINGS.FINAL_ACTION_DATE) Between [Beginning
Date?] And [Ending Date?]) AND ((MO_DOI_LAH_EVENTS.EVENT_CODE) Is Null)) OR
(((MO_DOI_LAH_EVENTS.EVENT_CODE)="R"))
ORDER BY MO_DOI_LAH_LEAD_FILINGS.FINAL_ACTION_DATE;

from previous posts:
Ok, that works, except now I'm prompted for dates, and I enter 7/1/05 and
7/31/05, and the results are showing me all dates, even ones that are not
within my date range. Am I doing something wrong?
As in my previous post, this works excellent! My next question is, how can
I ONLY return those lines with an "R" or Null value?
In my query I get several values for my EVENT_CODE field. I am only looking
to find the "R" code and the null codes. For the "R" codes I would like to
show a "Y" for yes, and for the null codes I would like to show a "N" for no.
Right now I have this in 2 different columns, but would if possible, like to
have this in 1 column.
 
Top