Solved

How format result in a SQL query

Posted on 2012-03-15
5
264 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 39

Expert Comment

by:Kyle Abrahams
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Here's a screenshot from the query builder:

B
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

In the previous article, Using a Critera Form to Filter Records (http://www.experts-exchange.com/A_6069.html), the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
Familiarize people with the process of utilizing SQL Server functions 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 Microsoft Ac…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.

743 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now