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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Return String from Boolean Field
Hi,
I have the following query collecting data from a table where 'Complete' field is a yes/no field. I am exporting this data for a PDF merge and what I need is the Strings 'Yes' or 'Off' from the query results for this field instead of a 0/1 value. Any ideas? Thank you. SELECT Businesses.BusinessName AS Business, Businesses.Address AS Address, Businesses.City AS City, Businesses.State AS State, Businesses.Zip+Businesses.ZipPlus AS Zip, Businesses.DocumentNo, Businesses.Complete FROM Businesses WHERE ((([Businesses].[Zip]+[Businesses].[ZipPlus])=99056)); |
#2
|
|||
|
|||
Return String from Boolean Field
On Tue, 25 May 2004 16:14:05 -0700, Dragon wrote:
Hi, I have the following query collecting data from a table where 'Complete' field is a yes/no field. I am exporting this data for a PDF merge and what I need is the Strings 'Yes' or 'Off' from the query results for this field instead of a 0/1 value. Any ideas? Thank you. SELECT Businesses.BusinessName AS Business, Businesses.Address AS Address, Businesses.City AS City, Businesses.State AS State, Businesses.Zip+Businesses.ZipPlus AS Zip, Businesses.DocumentNo, Businesses.Complete FROM Businesses WHERE ((([Businesses].[Zip]+[Businesses].[ZipPlus])=99056)); 1) A Yes/No Check box field does not return a value of 0 or 1, it returns a value of 0 or -1. 2) You asked for 0/1 Yes or Off? not 1/0 Yes or No? Change the SQL to: SELECT Businesses.BusinessName AS Business, Businesses.Address AS Address, Businesses.City AS City, Businesses.State AS State, Businesses.Zip+Businesses.ZipPlus AS Zip, Businesses.DocumentNo, IIf(Businesses.Complete = -1,"Off","Yes" as Completed FROM Businesses WHERE ((([Businesses].[Zip]+[Businesses].[ZipPlus])=99056)); Then use the [Completed] field in the export. -- Fred Please only reply to this newsgroup. I do not reply to personal email. |
#3
|
|||
|
|||
Return String from Boolean Field
Great. Thank you.
Yes, I did need 'Yes' and 'Off' :-) "fredg" wrote in message ... On Tue, 25 May 2004 16:14:05 -0700, Dragon wrote: Hi, I have the following query collecting data from a table where 'Complete' field is a yes/no field. I am exporting this data for a PDF merge and what I need is the Strings 'Yes' or 'Off' from the query results for this field instead of a 0/1 value. Any ideas? Thank you. SELECT Businesses.BusinessName AS Business, Businesses.Address AS Address, Businesses.City AS City, Businesses.State AS State, Businesses.Zip+Businesses.ZipPlus AS Zip, Businesses.DocumentNo, Businesses.Complete FROM Businesses WHERE ((([Businesses].[Zip]+[Businesses].[ZipPlus])=99056)); 1) A Yes/No Check box field does not return a value of 0 or 1, it returns a value of 0 or -1. 2) You asked for 0/1 Yes or Off? not 1/0 Yes or No? Change the SQL to: SELECT Businesses.BusinessName AS Business, Businesses.Address AS Address, Businesses.City AS City, Businesses.State AS State, Businesses.Zip+Businesses.ZipPlus AS Zip, Businesses.DocumentNo, IIf(Businesses.Complete = -1,"Off","Yes" as Completed FROM Businesses WHERE ((([Businesses].[Zip]+[Businesses].[ZipPlus])=99056)); Then use the [Completed] field in the export. -- Fred Please only reply to this newsgroup. I do not reply to personal email. |
Thread Tools | |
Display Modes | |
|
|