A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

If Statement



 
 
Thread Tools Display Modes
  #1  
Old June 18th, 2004, 09:24 PM
wperez
external usenet poster
 
Posts: n/a
Default If Statement

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
  #2  
Old June 18th, 2004, 09:51 PM
Lynn Trapp
external usenet poster
 
Posts: n/a
Default If Statement

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" wrote in message
...
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



  #3  
Old June 18th, 2004, 10:03 PM
wperez
external usenet poster
 
Posts: n/a
Default If Statement

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" wrote:

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" wrote in message
...
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




  #4  
Old June 18th, 2004, 10:06 PM
wperez
external usenet poster
 
Posts: n/a
Default If Statement

Sorry this is if [Estimate]="e"

"wperez" wrote:

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" wrote:

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" wrote in message
...
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




  #5  
Old June 18th, 2004, 10:09 PM
Lynn Trapp
external usenet poster
 
Posts: n/a
Default If Statement

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" wrote in message
...
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" wrote:

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" wrote in message
...
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






  #6  
Old June 18th, 2004, 10:34 PM
wperez
external usenet poster
 
Posts: n/a
Default If Statement

Thank you so much for you help! It worked perfectly.

"Lynn Trapp" wrote:

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" wrote in message
...
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" wrote:

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" wrote in message
...
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






  #7  
Old June 18th, 2004, 10:46 PM
Lynn Trapp
external usenet poster
 
Posts: n/a
Default If Statement

You are quite welcome.

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


"wperez" wrote in message
...
Thank you so much for you help! It worked perfectly.

"Lynn Trapp" wrote:

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" wrote in message
...
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" wrote:

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" wrote in message
...
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








 




Thread Tools
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 Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 04:55 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.