Solved

How format result in a SQL query

Posted on 2012-03-15
5
266 Views
Last Modified: 2012-03-15
I have this in a query design (SQL view) for a listbox:

Format(tblPrintOrdDistribution.PrintOrdDetailComplete) AS Complete

Which is fine.  The name of the column is "Complete" which is what I want.  But the result is showing -1 and I want it to be Yes or No.  

What do I do with the syntax to make that happen?

--Steve
0
Comment
Question by:SteveL13
5 Comments
 
LVL 40

Expert Comment

by:Kyle Abrahams
ID: 37726366
is PrintOrdDetailComplete an integer?

can you do Format(case when PrintOrdDetailComplete = -1 then 'No' else 'Yes' end)  AS Complete
0
 
LVL 3

Expert Comment

by:MrHswede
ID: 37726373
If possible use case when x = -1 then no else yes end as complete
0
 
LVL 33

Accepted Solution

by:
Norie earned 500 total points
ID: 37726382
You don't seem to be doing any formatting there - there's no format string.

Anyways, instead of formatting you could try this expression.

Complete:Iif(tblPrintOrdDistribution.PrintOrdDetailComplete=-1, "Yes", "No")
0
 
LVL 61

Expert Comment

by:mbizup
ID: 37726389
Nothing with the syntax...

- Select the column in the query designer
- Right-click and select "Properties"

You can set the format of your Boolean field to Y/N here.
0
 
LVL 61

Expert Comment

by:mbizup
ID: 37726411
Here's a screenshot from the query builder:

B
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Most if not all databases provide tools to filter data; even simple mail-merge programs might offer basic filtering capabilities. This is so important that, although Access has many built-in features to help the user in this task, developers often n…
Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question