[mso] Re: Access 2002: Force 'Yes/No' Format in Make-Table Query
- From: Cathy.Evans@xxxxxxxxx
- To: mso@xxxxxxxxxxxxx
- Date: Fri, 20 Aug 2004 12:09:08 -0400
Hi Jim! Thanks. I'm getting a data type mismatch error with below, I was
getting one before when I tried several things, and thought the problem was
because it was not formatted as a true yes/no field and had an alpha
character in the results before I filtered it out. So I thought I had to
force the format when I made a new table.
However! Testing various aspects of your code caused me to remember that I
could put a check box field on the form and have my yes/no as the control
source. Thanks for jogging my memory and helping me think this out. The
ultimate need was for the user to have an easy check mark they could
visually see what was happening instead of reading words!
Thank you very much, I'm back in business now!
Cheers, Cathy
"Jim Pettit"
<j_e_pettit@hotmail To: <mso@xxxxxxxxxxxxx>
.com>
Sent by: cc:
mso-bounce@freelist
s.org Subject: [mso] Re: Access 2002:
Force 'Yes/No' Format in Make-Table
08/20/2004 11:12 AM Query
Please respond to
mso
.....
Kathy--
An 'IIf' will do the trick:
SELECT DISTINCT qun_ClosedProjects.ContractNo,
Iif([qun_ClosedProjects.WBSStatusId] = 0, "NO", "YES") INTO
tbl_ClosedProjects IN 'I:
\ServerPath\MasterData_be.mdb'
FROM qun_ClosedProjects LEFT JOIN tbl_Close_Projects ON
qun_ClosedProjects.ContractNo = tbl_Close_Projects.ProjectNo
GROUP BY qun_ClosedProjects.ContractNo, qun_ClosedProjects.WBSStatusId
HAVING (((qun_ClosedProjects.WBSStatusId)<>"C"))
ORDER BY qun_ClosedProjects.ContractNo;
Although I have to tell you that if you're using YES/NO fields, the value
-1
*is* Yes/True, While 0 is No/False. Out of curiosity, are you forcing the
change because you want to see the textual values 'Yes' and 'No'? If not --
that is, if you are just storing the results of the query -- you may want
to
consider leaving the values as is.
--Jim
-----Original Message-----
From: mso-bounce@xxxxxxxxxxxxx [mailto:mso-bounce@xxxxxxxxxxxxx] On Behalf
Of Cathy.Evans@xxxxxxxxx
Sent: Friday, August 20, 2004 7:30 AM
To: mso@xxxxxxxxxxxxx
Subject: [mso] Access 2002: Force 'Yes/No' Format in Make-Table Query
Hi! How do I force a Yes/No in a make table query when the field results
are -1 or 0? The SQL is below. I'm pulling the WBSStatusID field from a
union query that originally had 3 results, C, -1 or 0. I'm filtering out
the C's on this query, but can't get the WBSStatusID field to format as a
Yes/No for the export. Thank you, Cathy
SELECT DISTINCT qun_ClosedProjects.ContractNo,
qun_ClosedProjects.WBSStatusId INTO tbl_ClosedProjects IN 'I:
\ServerPath\MasterData_be.mdb'
FROM qun_ClosedProjects LEFT JOIN tbl_Close_Projects ON
qun_ClosedProjects.ContractNo = tbl_Close_Projects.ProjectNo
GROUP BY qun_ClosedProjects.ContractNo, qun_ClosedProjects.WBSStatusId
HAVING (((qun_ClosedProjects.WBSStatusId)<>"C"))
ORDER BY qun_ClosedProjects.ContractNo;
-----------------------------------------------------------------------------------------------------
The information transmitted is intended only for the person
or entity to which it is addressed and may contain confidential
and/or privileged material. If you are not the intended recipient
of this message you are hereby notified that any use, review,
retransmission, dissemination, distribution, reproduction or any
action taken in reliance upon this message is prohibited. If you
received this in error, please contact the sender and delete the
material from any computer. Any views expressed in this message
are those of the individual sender and may not necessarily reflect
the views of the company.
-------------------------------------------------------------------------------------------------------
*************************************************************
You are receiving this mail because you subscribed to mso@xxxxxxxxxxxxx or
MicrosoftOffice@xxxxxxxxxxxxxxxx
To send mail to the group, simply address it to mso@xxxxxxxxxxxxx
To Unsubscribe from this group, send an email to
mso-request@xxxxxxxxxxxxx with the word "unsubscribe" (without the quotes) in
the subject line.
Or, visit the group's homepage and use the dropdown menu. This will also allow
you to change your email settings to digest or vacation (no mail).
http://www.freelists.org/webpage/mso
To be able to use the files section for sharing files with the group, send a
request to mso-moderators@xxxxxxxxxxxxx and you will be sent an invitation with
instructions. Once you are a member of the files group, you can go here to
upload/download files:
http://www.smartgroups.com/vault/msofiles
*************************************************************
Other related posts: