Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 276
  • 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
 
NorieData ProcessorCommented:
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

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

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