Addition Query

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a field called destruction date in a table which I enter a year, for
example 2002. I also have a field called years which is a selection from a
table years. In my query I am adding the destruction date (2002) plus the
years field (5) in a field called expression. My problem is that if I do not
select any years in the expression field it show the original destruction
date (2002). How can I keep this addition function working but if there is
no Years selected if remains blank. Thanking you in advance.
 
Confused I am.
If you do not select any years to add to the destruction date and result in
destruction date it seems to me that any date puls no years will equal the
orignal date.
Or do you want it not to show anything if no years are selected?
Then maybe like this --
Expression: IIF([[Years] Is Null Or [Years] = 0, Null, [Destruction_Date])
 
Yes thank you. If destruction date is entered and there is no number of
years it has to be kept I don't want a date showing in the "expression" so I
think your equation will work. Do I put this in the criteria in the query in
my "expression" field? Thanks so much.

KARL DEWEY said:
Confused I am.
If you do not select any years to add to the destruction date and result in
destruction date it seems to me that any date puls no years will equal the
orignal date.
Or do you want it not to show anything if no years are selected?
Then maybe like this --
Expression: IIF([[Years] Is Null Or [Years] = 0, Null, [Destruction_Date])

--
KARL DEWEY
Build a little - Test a little


LindaC said:
I have a field called destruction date in a table which I enter a year, for
example 2002. I also have a field called years which is a selection from a
table years. In my query I am adding the destruction date (2002) plus the
years field (5) in a field called expression. My problem is that if I do not
select any years in the expression field it show the original destruction
date (2002). How can I keep this addition function working but if there is
no Years selected if remains blank. Thanking you in advance.
 
Open the query in design view. Put it in the grid.
--
KARL DEWEY
Build a little - Test a little


LindaC said:
Yes thank you. If destruction date is entered and there is no number of
years it has to be kept I don't want a date showing in the "expression" so I
think your equation will work. Do I put this in the criteria in the query in
my "expression" field? Thanks so much.

KARL DEWEY said:
Confused I am.
If you do not select any years to add to the destruction date and result in
destruction date it seems to me that any date puls no years will equal the
orignal date.
Or do you want it not to show anything if no years are selected?
Then maybe like this --
Expression: IIF([[Years] Is Null Or [Years] = 0, Null, [Destruction_Date])

--
KARL DEWEY
Build a little - Test a little


LindaC said:
I have a field called destruction date in a table which I enter a year, for
example 2002. I also have a field called years which is a selection from a
table years. In my query I am adding the destruction date (2002) plus the
years field (5) in a field called expression. My problem is that if I do not
select any years in the expression field it show the original destruction
date (2002). How can I keep this addition function working but if there is
no Years selected if remains blank. Thanking you in advance.
 
Back
Top