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  

Absolute value of a checkbox in a query



 
 
Thread Tools Display Modes
  #1  
Old May 27th, 2004, 09:14 PM
MarkD
external usenet poster
 
Posts: n/a
Default Absolute value of a checkbox in a query

Using Access 2000

I have a query based on a table with a bunch of check
boxes. I want to sum the checkboxes based on a field then
transfer that to an Excel sheet. However, Access uses a -1
for a "yes" value instead of a 1. I know I can sum on the
absolute value of each field, but that requires me to
modify each field in the query. Is there a simpler way to
do this?

On an aside, what is the reason Microsoft chose to use
this instead of plain ol' 1?

Thanks,
-Mark

  #2  
Old May 27th, 2004, 09:45 PM
tina
external usenet poster
 
Posts: n/a
Default Absolute value of a checkbox in a query

try

Sum(IIf([CheckboxName] = 0, 0, 1))

no answer for the second question, i'm afraid.

hth


"MarkD" wrote in message
...
Using Access 2000

I have a query based on a table with a bunch of check
boxes. I want to sum the checkboxes based on a field then
transfer that to an Excel sheet. However, Access uses a -1
for a "yes" value instead of a 1. I know I can sum on the
absolute value of each field, but that requires me to
modify each field in the query. Is there a simpler way to
do this?

On an aside, what is the reason Microsoft chose to use
this instead of plain ol' 1?

Thanks,
-Mark



  #3  
Old May 27th, 2004, 09:58 PM
MarkD
external usenet poster
 
Posts: n/a
Default Absolute value of a checkbox in a query

Thanks Tina...

Yeah, I know I can do that (or variants thereof), but I
don't want to change each of the 30 checkbox fields. I was
hoping there'd be a global way to change things. I'm just
lazy, I guess.

-Mark



-----Original Message-----
try

Sum(IIf([CheckboxName] = 0, 0, 1))

no answer for the second question, i'm afraid.

hth


"MarkD" wrote in

message
...
Using Access 2000

I have a query based on a table with a bunch of check
boxes. I want to sum the checkboxes based on a field

then
transfer that to an Excel sheet. However, Access uses

a -1
for a "yes" value instead of a 1. I know I can sum on

the
absolute value of each field, but that requires me to
modify each field in the query. Is there a simpler way

to
do this?

On an aside, what is the reason Microsoft chose to use
this instead of plain ol' 1?

Thanks,
-Mark



.

  #4  
Old May 28th, 2004, 02:47 AM
tina
external usenet poster
 
Posts: n/a
Default MORE HELP, ANYBODY? Absolute value of a checkbox in a query

well, i can't think of anything that wouldn't require you to enumerate the
fields in some fashion - even if you use a public function, you'd still have
to substitute the function call for each field in your query.
there may be a more elegant way, but it's beyond me. maybe somebody else
will post a solution, and we'll both learn something.


"MarkD" wrote in message
...
Thanks Tina...

Yeah, I know I can do that (or variants thereof), but I
don't want to change each of the 30 checkbox fields. I was
hoping there'd be a global way to change things. I'm just
lazy, I guess.

-Mark



-----Original Message-----
try

Sum(IIf([CheckboxName] = 0, 0, 1))

no answer for the second question, i'm afraid.

hth


"MarkD" wrote in

message
...
Using Access 2000

I have a query based on a table with a bunch of check
boxes. I want to sum the checkboxes based on a field

then
transfer that to an Excel sheet. However, Access uses

a -1
for a "yes" value instead of a 1. I know I can sum on

the
absolute value of each field, but that requires me to
modify each field in the query. Is there a simpler way

to
do this?

On an aside, what is the reason Microsoft chose to use
this instead of plain ol' 1?

Thanks,
-Mark



.



  #5  
Old May 28th, 2004, 06:09 PM
MarkD
external usenet poster
 
Posts: n/a
Default MORE HELP, ANYBODY? Absolute value of a checkbox in a query

Thanks again Tina,

Hopefully there is a quick-n-ditry solution, but it looks
like I gotta change all fields manually. And I so wanted
my Friday before Memorial Day to be a lazy day at work!

-Mark

-----Original Message-----
well, i can't think of anything that wouldn't require you

to enumerate the
fields in some fashion - even if you use a public

function, you'd still have
to substitute the function call for each field in your

query.
there may be a more elegant way, but it's beyond me.

maybe somebody else
will post a solution, and we'll both learn something.


"MarkD" wrote in

message
...
Thanks Tina...

Yeah, I know I can do that (or variants thereof), but I
don't want to change each of the 30 checkbox fields. I

was
hoping there'd be a global way to change things. I'm

just
lazy, I guess.

-Mark



-----Original Message-----
try

Sum(IIf([CheckboxName] = 0, 0, 1))

no answer for the second question, i'm afraid.

hth


"MarkD" wrote in

message
...
Using Access 2000

I have a query based on a table with a bunch of check
boxes. I want to sum the checkboxes based on a field

then
transfer that to an Excel sheet. However, Access uses

a -1
for a "yes" value instead of a 1. I know I can sum on

the
absolute value of each field, but that requires me to
modify each field in the query. Is there a simpler

way
to
do this?

On an aside, what is the reason Microsoft chose to

use
this instead of plain ol' 1?

Thanks,
-Mark



.



.

 




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 11:35 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.