You need to understand what the IIF statement is doing in the Select
It is taking the Boolean field named "Stock" and creating a New (text) Field named "YesOrNo" with a string value or "Yes" or "No"
depending on whether the value of Stock is True ( <>0 actually -1 in Access and +1 in SQL ) or False ( =0 )
IIF(Stock <> 0, 'Yes', 'No') means
IIF(expression, resultIfTrue, resultIfFalse)
So Stock will always show up as True or False and remain a Boolean in your page
But the new text field (now named "YesOrNo") will show up as Text of "Yes" or "No" and no longer be Boolean (if you call the Field
named YesOrNo in your page)
- sort of defeats the purpose of having a Boolean field in the 1st place
FYI
IIF is not a valid VB Script construct
(it is a VBA construct that "happens" to work in VB Script because Access supports it)
That's why I recommended my alternative where you preserve the Boolean nature of the field and display it any way you want to
| Stefan,
| I was hoping that the term "TrueFalseField" was a global thing. I have 5
| fields that I want to change from True/False to Yes/No. Anyway, here's my
| entire SQL statement and by the way, even though I have added one correct
| field name, the results for this field are still using True/False!!????:
|
| SELECT IIF(Stock <> 0, 'Yes', 'No') AS YesOrNo, * FROM
| T_MasterPECTableforAllPEC WHERE (PEC Like '%:

EC::%' OR PartNumberorALIAS
| Like '%:

artNumberorALIAS::%' OR Sortcode Like '%::Sortcode::%' or
| TECHNOLOGY Like '%::Technology::%')
|
| I really appreciate the time that you're putting into this.
| Bob
| "Stefan B Rusynko" wrote:
|
| > That is telling you your select statement is incomplete
| >
| > Post your real new Select statement
| > - is the field in the example given to you renamed to match your real db field name
| >
| > IMHO
| > The approach of using the IIF in the Select is overkill
| >
| > If you just want a field (named say: TrueFalseField ) that is True/False to display Yes/No
| > in the display just use:
| >
| > If TrueFalseField = True then
| > strTrueFalseField = "Yes"
| > Else
| > strTrueFalseField = "No"
| >
| > And display it using <%=strTrueFalseField%>
| >
| > --
| >
| > _____________________________________________
| > SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
| > "Warning - Using the F1 Key will not break anything!" (-;
| > To find the best Newsgroup for FrontPage support see:
| >
http://www.net-sites.com/sitebuilder/newsgroups.asp
| > _____________________________________________
| >
| >
| > | Stefan,
| > |
| > | Here is the error message:
| > |
| > | Description: [Microsoft][ODBC Microsoft Access Driver] Too few parameters.
| > | Expected 5.
| > | Number: -2147217904 (0x80040E10)
| > | Source: Microsoft OLE DB Provider for ODBC Drivers
| > |
| > | Does this help?
| > |
| > | Bob
| > |
| > | "Stefan B Rusynko" wrote:
| > |
| > | > To see the true error, open the hidden folder /_fpclass/ and edit the fpdbrgn1.inc file
| > | >
| > | > At about line 19, change :
| > | > fp_DEBUG = False
| > | > to :
| > | > fp_DEBUG = True
| > | >
| > | >
| > | > --
| > | >
| > | > _____________________________________________
| > | > SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
| > | > "Warning - Using the F1 Key will not break anything!" (-;
| > | > To find the best Newsgroup for FrontPage support see:
| > | >
http://www.net-sites.com/sitebuilder/newsgroups.asp
| > | > _____________________________________________
| > | >
| > | >
| > | > | Bob,
| > | > | There's some code you can add to show the true error message - that will
| > | > | give us something to work from. Give me a few minutes, I'll find it and post
| > | > | back
| > | > |
| > | > | --
| > | > | Cheers,
| > | > | Jon
| > | > | Microsoft MVP
| > | > |
| > | > |
| > | > | | > | > | > Jon,
| > | > | > Thanks for your reply. I think we're getting closer. Placing the comma
| > | > | > in
| > | > | > the proper spot has helped while I'm in FrontPage in that the query now
| > | > | > verifies, but when I save the page and preview it in IE I get the database
| > | > | > results error:
| > | > | > Database Results Error
| > | > | > The operation failed. If this continues, please contact your server
| > | > | > Is this SQL statement relient on FrontPage server extensions? Should I be
| > | > | > getting the server administrator involved with this or could it be an IE
| > | > | > problem or an ASP problem.
| > | > | > I'm just fishing here cause I don't know what else to do.
| > | > | > Thanks again for your help.
| > | > | > Bob
| > | > | >
| > | > | > "Jon Spivey" wrote:
| > | > | >
| > | > | >> Hi Bob,
| > | > | >>
| > | > | >> I wrote the reply that Kathleen quoted. You just need a comma between AS
| > | > | >> YesOrNo and * -
| > | > | >> SELECT IIF(TrueFalseField <> 0, 'Yes', 'No') AS YesOrNo, * FROM
| > | > | >> rest as you have it
| > | > | >>
| > | > | >> --
| > | > | >> Cheers,
| > | > | >> Jon
| > | > | >> Microsoft MVP
| > | > | >>
| > | > | >>
| > | > | >> | > | > | >> > Kathleen,
| > | > | >> > I tried putting the text in the message that you refered to into the
| > | > | >> > custom
| > | > | >> > query in the FrontPage database results properties so that it looks
| > | > | >> > like
| > | > | >> > this:
| > | > | >> > SELECT IIF(TrueFalseField <> 0, 'Yes', 'No') AS YesOrNo * FROM
| > | > | >> > T_MasterPECTableforAllPEC WHERE (PEC Like '%:

EC::%' OR
| > | > | >> > PartNumberorALIAS
| > | > | >> > Like '%:

artNumberorALIAS::%' OR Sortcode Like '%::Sortcode::%' or
| > | > | >> > TECHNOLOGY Like '%::Technology::%')
| > | > | >> > but that didn't work as FrontPage reports that there is an error in the
| > | > | >> > query.
| > | > | >> > If I remove the * from the query then it removes the error reported by
| > | > | >> > FrontPage, but the query no longer works in the browser. I get this
| > | > | >> > message
| > | > | >> > from the search engine:
| > | > | >> > Database Results Error
| > | > | >> > The operation failed. If this continues, please contact your server
| > | > | >> > administrator.
| > | > | >> > Do you have any other ideas?
| > | > | >> >
| > | > | >> > "Kathleen Anderson [MVP - FrontPage]" wrote:
| > | > | >> >
| > | > | >> >>
| > | >
| >
http://groups-beta.google.com/group...fbfc2539?q=yes+no+true+false#ca5ffc7dfbfc2539
| > | > | >> >>
| > | > | >> >> --
| > | > | >> >>
| > | > | >> >> ~ Kathleen Anderson
| > | > | >> >> Microsoft MVP - FrontPage
| > | > | >> >> Spider Web Woman Designs
| > | > | >> >> web:
http://www.spiderwebwoman.com/resources/
| > | > | >> >> blog:
http://msmvps.com/spiderwebwoman/category/321.aspx
| > | > | >> >>
| > | > | >> >>
| > | > | >> >> > I have a search form that uses Access database as the back end and
| > | > | >> >> > some of the form fields are Yes/No check boxes. The default results
| > | > | >> >> > for these fields ar "True" and "False" and I would like to change
| > | > | >> >> > these to read "Yes" and "No". Is this possible, and how is it done?
| > | > | >> >> >
| > | > | >> >> > Your input would be appreciated.
| > | > | >> >>
| > | > | >> >>
| > | > | >>
| > | > | >>
| > | > | >>
| > | > |
| > | > |
| > | >
| > | >
| > | >
| >
| >
| >