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 » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Update query with true/false



 
 
Thread Tools Display Modes
  #1  
Old November 4th, 2008, 06:48 PM posted to microsoft.public.access
Radhika
external usenet poster
 
Posts: 107
Default Update query with true/false

I have created an update query with the following criteria:
VP OtherGlue on valve/fringe = True
1. When VPOther:Extra Increased Resistance is True
2. When VPOther: Extra Extra Increased Resistance is True
3. When VP Type=VPOther:Increased Resistance and VPType='InHealth
Indwelling' or 'InHealth Low pressure'

I want to include in this SQL a criterion saying that if the obove mentioned
fields are false, VPOtherGlue on valve/fringe = False. Therefore, when the
obove-metioned check boxes are checked, VPOtherGlue on valve/fringe should be
check. If they are not, VPOtherGlue on valve/fringe should not.

How do I go about doing this?

Thankyou,
Radhika
  #2  
Old November 4th, 2008, 07:27 PM posted to microsoft.public.access
Douglas J. Steele[_3_]
external usenet poster
 
Posts: 3,143
Default Update query with true/false

If the value of VPOtherGlue is solely dependent upon the values of other
fields in the same row, it shouldn't be stored in the table at all.

Instead, you should create a query that has a computed field VPOtherGlue in
it. You'd put something like this in a blank cell on the Field row of the
query builder:

VPOtherGlue: [VPOther:Extra Increased Resistance] AND [VPOther: Extra Extra
Increased Resistance} AND([VPOther:Increased Resistance] AND
[VPType='InHealth Indwelling' or VPType=''InHealth Low pressure')

Use that query wherever you would otherwise have used the table.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"Radhika" wrote in message
...
I have created an update query with the following criteria:
VP OtherGlue on valve/fringe = True
1. When VPOther:Extra Increased Resistance is True
2. When VPOther: Extra Extra Increased Resistance is True
3. When VP Type=VPOther:Increased Resistance and VPType='InHealth
Indwelling' or 'InHealth Low pressure'

I want to include in this SQL a criterion saying that if the obove
mentioned
fields are false, VPOtherGlue on valve/fringe = False. Therefore, when the
obove-metioned check boxes are checked, VPOtherGlue on valve/fringe should
be
check. If they are not, VPOtherGlue on valve/fringe should not.

How do I go about doing this?

Thankyou,
Radhika



  #3  
Old November 4th, 2008, 08:10 PM posted to microsoft.public.access
Radhika
external usenet poster
 
Posts: 107
Default Update query with true/false

Thank you.

My only concern is that I do need the field in the table. There are other
fields in the table which will be filled in based on the value of VPOtherGlue.

Is there any way in which i can do this in the table?

"Douglas J. Steele" wrote:

If the value of VPOtherGlue is solely dependent upon the values of other
fields in the same row, it shouldn't be stored in the table at all.

Instead, you should create a query that has a computed field VPOtherGlue in
it. You'd put something like this in a blank cell on the Field row of the
query builder:

VPOtherGlue: [VPOther:Extra Increased Resistance] AND [VPOther: Extra Extra
Increased Resistance} AND([VPOther:Increased Resistance] AND
[VPType='InHealth Indwelling' or VPType=''InHealth Low pressure')

Use that query wherever you would otherwise have used the table.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"Radhika" wrote in message
...
I have created an update query with the following criteria:
VP OtherGlue on valve/fringe = True
1. When VPOther:Extra Increased Resistance is True
2. When VPOther: Extra Extra Increased Resistance is True
3. When VP Type=VPOther:Increased Resistance and VPType='InHealth
Indwelling' or 'InHealth Low pressure'

I want to include in this SQL a criterion saying that if the obove
mentioned
fields are false, VPOtherGlue on valve/fringe = False. Therefore, when the
obove-metioned check boxes are checked, VPOtherGlue on valve/fringe should
be
check. If they are not, VPOtherGlue on valve/fringe should not.

How do I go about doing this?

Thankyou,
Radhika




  #4  
Old November 4th, 2008, 08:43 PM posted to microsoft.public.access
Douglas J. Steele[_3_]
external usenet poster
 
Posts: 3,143
Default Update query with true/false

It's almost always a mistake to store calculated values in a table.

As fellow Access MVP John Vinson likes to say "Storing calculated data
generally accomplishes only three things: it wastes disk space, it wastes
time (a disk fetch is much slower than almost any reasonable calculation),
and it risks data validity, since once it's stored in a table either the
Total or one of the fields that goes into the total may be changed, making
the value WRONG."

If you're determined to do it, though, your Update query would be something
like:

UPDATE MyTable
SET VPOtherGlue = VPOther:Extra Increased Resistance] AND [VPOther: Extra
Extra
Increased Resistance} AND([VPOther:Increased Resistance] AND
[VPType='InHealth Indwelling' or VPType=''InHealth Low pressure')



--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"Radhika" wrote in message
...
Thank you.

My only concern is that I do need the field in the table. There are other
fields in the table which will be filled in based on the value of
VPOtherGlue.

Is there any way in which i can do this in the table?

"Douglas J. Steele" wrote:

If the value of VPOtherGlue is solely dependent upon the values of other
fields in the same row, it shouldn't be stored in the table at all.

Instead, you should create a query that has a computed field VPOtherGlue
in
it. You'd put something like this in a blank cell on the Field row of the
query builder:

VPOtherGlue: [VPOther:Extra Increased Resistance] AND [VPOther: Extra
Extra
Increased Resistance} AND([VPOther:Increased Resistance] AND
[VPType='InHealth Indwelling' or VPType=''InHealth Low pressure')

Use that query wherever you would otherwise have used the table.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"Radhika" wrote in message
...
I have created an update query with the following criteria:
VP OtherGlue on valve/fringe = True
1. When VPOther:Extra Increased Resistance is True
2. When VPOther: Extra Extra Increased Resistance is True
3. When VP Type=VPOther:Increased Resistance and VPType='InHealth
Indwelling' or 'InHealth Low pressure'

I want to include in this SQL a criterion saying that if the obove
mentioned
fields are false, VPOtherGlue on valve/fringe = False. Therefore, when
the
obove-metioned check boxes are checked, VPOtherGlue on valve/fringe
should
be
check. If they are not, VPOtherGlue on valve/fringe should not.

How do I go about doing this?

Thankyou,
Radhika






 




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 09:12 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.