If Statement

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

Guest

Hi,
I have a query with two fields, one is [Total Volume] the other is [Estimate]. Is it possible to create a query that will give me the following results, and if so how?
If [Estimate] = "e" Then [Total Volume] = 0

Any help would be greatly appreciated.

Thanks,
WP
 
Are you trying to set the value of [Total Volume] to 0 for every record in
your table where the value of [Estimate] is 0? If so then you can run the
following update query:

UPDATE YourTable
SET [Total Volume] = 0
WHERE [Estimate] = "e";

If that is not what you want then feel free to post more information.

--
Lynn Trapp
MS Access MVP
www.ltcomputerdesigns.com
Access Security: www.ltcomputerdesigns.com/Security.htm


wperez said:
Hi,
I have a query with two fields, one is [Total Volume] the other is
[Estimate]. Is it possible to create a query that will give me the
following results, and if so how?
If [Estimate] = "e" Then [Total Volume] = 0

Any help would be greatly appreciated.

Thanks,
WP
 
Hi,
Sorry I should have been more specific and perhaps this is really a report question. I created a query in order to build a report (there are multiple fields in the query not related to the question). I do not want to update the information in the table itself but for my report purposes I need the value of [Total Volume] to be "0" or blank if [Estimate] = 0

Thanks,
WP

Lynn Trapp said:
Are you trying to set the value of [Total Volume] to 0 for every record in
your table where the value of [Estimate] is 0? If so then you can run the
following update query:

UPDATE YourTable
SET [Total Volume] = 0
WHERE [Estimate] = "e";

If that is not what you want then feel free to post more information.

--
Lynn Trapp
MS Access MVP
www.ltcomputerdesigns.com
Access Security: www.ltcomputerdesigns.com/Security.htm


wperez said:
Hi,
I have a query with two fields, one is [Total Volume] the other is
[Estimate]. Is it possible to create a query that will give me the
following results, and if so how?
If [Estimate] = "e" Then [Total Volume] = 0

Any help would be greatly appreciated.

Thanks,
WP
 
Sorry this is if [Estimate]="e"

wperez said:
Hi,
Sorry I should have been more specific and perhaps this is really a report question. I created a query in order to build a report (there are multiple fields in the query not related to the question). I do not want to update the information in the table itself but for my report purposes I need the value of [Total Volume] to be "0" or blank if [Estimate] = 0

Thanks,
WP

Lynn Trapp said:
Are you trying to set the value of [Total Volume] to 0 for every record in
your table where the value of [Estimate] is 0? If so then you can run the
following update query:

UPDATE YourTable
SET [Total Volume] = 0
WHERE [Estimate] = "e";

If that is not what you want then feel free to post more information.

--
Lynn Trapp
MS Access MVP
www.ltcomputerdesigns.com
Access Security: www.ltcomputerdesigns.com/Security.htm


wperez said:
Hi,
I have a query with two fields, one is [Total Volume] the other is
[Estimate]. Is it possible to create a query that will give me the
following results, and if so how?
If [Estimate] = "e" Then [Total Volume] = 0

Any help would be greatly appreciated.

Thanks,
WP
 
Ah, in that case, put an unbound control on your report and put the
following in the control source:

=IIF([Estimate] = "e", 0, [Total Volume])

--
Lynn Trapp
MS Access MVP
www.ltcomputerdesigns.com
Access Security: www.ltcomputerdesigns.com/Security.htm


wperez said:
Hi,
Sorry I should have been more specific and perhaps this is really a report
question. I created a query in order to build a report (there are multiple
fields in the query not related to the question). I do not want to update
the information in the table itself but for my report purposes I need the
value of [Total Volume] to be "0" or blank if [Estimate] = 0
Thanks,
WP

Lynn Trapp said:
Are you trying to set the value of [Total Volume] to 0 for every record in
your table where the value of [Estimate] is 0? If so then you can run the
following update query:

UPDATE YourTable
SET [Total Volume] = 0
WHERE [Estimate] = "e";

If that is not what you want then feel free to post more information.

--
Lynn Trapp
MS Access MVP
www.ltcomputerdesigns.com
Access Security: www.ltcomputerdesigns.com/Security.htm


wperez said:
Hi,
I have a query with two fields, one is [Total Volume] the other is
[Estimate]. Is it possible to create a query that will give me the
following results, and if so how?
If [Estimate] = "e" Then [Total Volume] = 0

Any help would be greatly appreciated.

Thanks,
WP
 
Thank you so much for you help! It worked perfectly.

Lynn Trapp said:
Ah, in that case, put an unbound control on your report and put the
following in the control source:

=IIF([Estimate] = "e", 0, [Total Volume])

--
Lynn Trapp
MS Access MVP
www.ltcomputerdesigns.com
Access Security: www.ltcomputerdesigns.com/Security.htm


wperez said:
Hi,
Sorry I should have been more specific and perhaps this is really a report
question. I created a query in order to build a report (there are multiple
fields in the query not related to the question). I do not want to update
the information in the table itself but for my report purposes I need the
value of [Total Volume] to be "0" or blank if [Estimate] = 0
Thanks,
WP

Lynn Trapp said:
Are you trying to set the value of [Total Volume] to 0 for every record in
your table where the value of [Estimate] is 0? If so then you can run the
following update query:

UPDATE YourTable
SET [Total Volume] = 0
WHERE [Estimate] = "e";

If that is not what you want then feel free to post more information.

--
Lynn Trapp
MS Access MVP
www.ltcomputerdesigns.com
Access Security: www.ltcomputerdesigns.com/Security.htm


Hi,
I have a query with two fields, one is [Total Volume] the other is
[Estimate]. Is it possible to create a query that will give me the
following results, and if so how?
If [Estimate] = "e" Then [Total Volume] = 0

Any help would be greatly appreciated.

Thanks,
WP
 
You are quite welcome.

--
Lynn Trapp
MS Access MVP
www.ltcomputerdesigns.com
Access Security: www.ltcomputerdesigns.com/Security.htm


wperez said:
Thank you so much for you help! It worked perfectly.

Lynn Trapp said:
Ah, in that case, put an unbound control on your report and put the
following in the control source:

=IIF([Estimate] = "e", 0, [Total Volume])

--
Lynn Trapp
MS Access MVP
www.ltcomputerdesigns.com
Access Security: www.ltcomputerdesigns.com/Security.htm


wperez said:
Hi,
Sorry I should have been more specific and perhaps this is really a
report
question. I created a query in order to build a report (there are multiple
fields in the query not related to the question). I do not want to update
the information in the table itself but for my report purposes I need the
value of [Total Volume] to be "0" or blank if [Estimate] = 0
Thanks,
WP

:

Are you trying to set the value of [Total Volume] to 0 for every
record
in
your table where the value of [Estimate] is 0? If so then you can
run
the
following update query:

UPDATE YourTable
SET [Total Volume] = 0
WHERE [Estimate] = "e";

If that is not what you want then feel free to post more information.

--
Lynn Trapp
MS Access MVP
www.ltcomputerdesigns.com
Access Security: www.ltcomputerdesigns.com/Security.htm


Hi,
I have a query with two fields, one is [Total Volume] the other is
[Estimate]. Is it possible to create a query that will give me the
following results, and if so how?
If [Estimate] = "e" Then [Total Volume] = 0

Any help would be greatly appreciated.

Thanks,
WP
 
Back
Top