Troubleshooting Percentage Criteria in a Query

Hi Everyone,

I have a table field called Confidence Level has the following characteristics:  
Date Type:  Number
Field Size:  Double
Format:  Percent
Decimal Places:  0

It has been pull into a query, upon which I want to apply a 80% or above criteria.  I typed in ">=0.8" into the criteria section, but it didn't work.  

Can anybody tell me why and how to fix it?  

Thanks,
Juju
JuJuChiaAsked:
Who is Participating?
 
DatabaseMX (Joe Anderson - Microsoft Access MVP)Connect With a Mentor Database ArchitectCommented:
ok ... you say the Data Type for [CONFIDENCE LEVEL] is Number.  What are some examples of actual data in that field ... not include how you have formatted it (PERCENT) ?

And why are you using Double if you have Decimal places set to 0 ?

mx
0
 
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database ArchitectCommented:
Can you post the SQL for the query?

mx
0
 
JuJuChiaAuthor Commented:
Yes, DatabaseMX, here it is.  

SELECT [Annual Forecast].ID, [Annual Forecast].DISTI, [Annual Forecast].[PART NUMBER], [Annual Forecast].MANU_PART, [Annual Forecast].CUSTOMER, [Annual Forecast].APPLICATION, [Annual Forecast].[QUOTE #], [Annual Forecast].[QUOTE PRICE], [Annual Forecast].SumOfQty, [Annual Forecast].[AvgOfSales Price], [Annual Forecast].[DISTI COST], [Annual Forecast].[PROD DATE], [Annual Forecast].[DESIGN STATUS], [Annual Forecast].[CONFIDENCE LEVEL], IIf([PROD DATE] Between Format(([Year]-1) Mod 100,'00') & 'Q2' And Format([Year] Mod 100,'00') & 'Q1',Int([EAU]/12)) AS Jan, [Jan] AS Feb, [Jan] AS Mar, IIf([PROD DATE] Between Format(([Year]-1) Mod 100,'00') & 'Q3' And Format([Year] Mod 100,'00') & 'Q2',Int([EAU]/12)) AS Apr, [Apr] AS May, [Apr] AS Jun, IIf([PROD DATE] Between Format(([Year]-1) Mod 100,'00') & 'Q4' And Format([Year] Mod 100,'00') & 'Q3',Int([EAU]/12)) AS Jul, [Jul] AS Aug, [Jul] AS Sep, IIf([PROD DATE] Between Format([Year] Mod 100,'00') & 'Q1' And Format([Year] Mod 100,'00') & 'Q4',Int([EAU]/12)) AS Oct, [Oct] AS Nov, [Oct] AS [Dec]
FROM [Annual Forecast]
WHERE ((([Annual Forecast].[PROD DATE]) Between Format(([Year]-1) Mod 100,'00') & 'Q2' And Format([Year] Mod 100,'00') & 'Q4') AND (([Annual Forecast].[DESIGN STATUS])="design win") AND (([Annual Forecast].[CONFIDENCE LEVEL])>=0.8)) OR ((([Annual Forecast].[DESIGN STATUS])="design in"));
0
 
JuJuChiaAuthor Commented:
Hi MX,

There are only 4 different actual data in the Confidence Level:  20%, 50%, 80%, 100%.  I imported them directly from an Excel spreadsheet as it is.  

I am not sure why I am using Double, I am actually pretty new to Access.  

Thanks,
Julia
0
 
hnasrConnect With a Mentor Commented:
"I am not sure why I am using Double"
Think of the values as decimal, .01, .9 This means use single, or double, or decimal

Looks like your query is ok, but try to simplify the query to select the only field with percent and analyze.
Ex:
SELECT tbl.p
FROM tbl
WHERE (((tbl.p)>=0.8));
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.

All Courses

From novice to tech pro — start learning today.