Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > VB How-To
|
VB How-To Ask your "How do I do this with VB?" questions in this forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 28th, 2004, 02:43 PM
Registered User
 
Join Date: Aug 2003
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default IIF in a query for a logical

I have a table using a logical. When I want to run a query to translate one value (-01) as 'Active', with the other value (0) as 'Inactive', I have tried, but get errors. Could someone tell me the proper syntax for the field in a QBE? I should be able to put this into a Union query.

tblVendor.Active (table, field)

e.g. Active: IIF([Active]=01, 'Active','Inactive')

Thanks!

- John


 
Old December 28th, 2004, 04:45 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,151
Thanks: 2
Thanked 14 Times in 14 Posts
Send a message via ICQ to SerranoG Send a message via AIM to SerranoG
Default

First you said that active is -01 but your IIF statement as 01. Which is it?

Second, is it a number or text or boolean? Respectively,

Active: IIF([Active]=-1,"Active", "Inactive")
Active: IIF([Active]="-01","Active", "Inactive")
Active: IIF([Active]=TRUE,"Active", "Inactive")

In Access booleans, -1 is TRUE and 0 is FALSE.


Greg Serrano
Michigan Dept. of Environmental Quality, Air Quality Division





Similar Threads
Thread Thread Starter Forum Replies Last Post
Logical operators ksskumar XSLT 3 November 11th, 2011 06:09 AM
Logical c# problem iinf C# 0 November 30th, 2006 10:33 AM
Query with IIF canmex Access 14 March 7th, 2006 03:07 AM
Nested Query with an iif statment Corey Access 7 October 17th, 2005 04:40 PM
Nested Query with an iif statment part 2 Corey Access 1 October 17th, 2005 12:47 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.