Querying Access table with Yes/No field Type

ht1234
10-12-2004, 11:55 PM
I've Access table with some Yes/No data type. How can I query with these field in DataReport without giving "-1" or "0" instead of I want to be in text word.
For example:

In Access, Residency field shows check that means person is permanent resident, when I query to show on Datareport, it shows "-1". How can I put convert these "number" to word, say (-1 -> Yes, 0 -> No)

Thanks

NEOLLE
10-13-2004, 02:57 AM
Hi ht1234,
You can use ENUM


Option Explicit

Private Enum YesNo_ENUM
Yes = -1
No = 0
End Enum

Private Sub Form_Load()
Dim strSQL As String

strSQL = "SELECT UserName FROM UserTables WHERE Resident = " & Yes
End Sub

ht1234
10-13-2004, 08:07 AM
Hi ht1234,
You can use ENUM


Option Explicit

Private Enum YesNo_ENUM
Yes = -1
No = 0
End Enum

Private Sub Form_Load()
Dim strSQL As String

strSQL = "SELECT UserName FROM UserTables WHERE Resident = " & Yes
End Sub


No, I'm able to query these fields but my question is how I can show "-1" in my query in Datareport with word???

Norenca
10-13-2004, 08:47 AM
I'm fairly new to Crystal Reports, but try adding a formula field with this formula:

IIF ({tblYourTable.YourField} = -1, "no", "yes")

NEOLLE
10-14-2004, 01:23 AM
Hello ht1234,
I believe you can there is an [If] function available for SQL. Im just not sure. If none, you can reference it from another table, where there holds the literal value for -1 as YES and 0 for NO. :)

MKoslof
10-15-2004, 08:58 PM
Crystal Reports does support the IIF statement :)..go with that if you need to use its functionality.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum