• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 279
  • Last Modified:

How format result in a SQL query

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
SteveL13
Asked:
SteveL13
1 Solution
 
Kyle AbrahamsSenior .Net DeveloperCommented:
is PrintOrdDetailComplete an integer?

can you do Format(case when PrintOrdDetailComplete = -1 then 'No' else 'Yes' end)  AS Complete
0
 
MrHswedeCommented:
If possible use case when x = -1 then no else yes end as complete
0
 
NorieVBA ExpertCommented:
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
 
mbizupCommented:
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
 
mbizupCommented:
Here's a screenshot from the query builder:

B
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Amazon Web Services - Basic

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now