Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Access Query

Posted on 2004-08-04
11
Medium Priority
?
255 Views
Last Modified: 2012-05-05
I have a table with three fields:

RecordID - Auto number
FileNumber - Numeric String
Validated - Boolean

I need to write a query to select the count of file numbers that were not validated i.e where Validated=False.
The trick is that there are could be multiple records for the same file number. And if a file number has a record where Validated=True it does not need to be counted. For example:

RecordID      FileNumber      Validated
1            123            True
2            123            False
3            123            True
4            456            False
5            678            False
6            678            False

The query should return 2
0
Comment
Question by:YZlat
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
  • 3
11 Comments
 
LVL 65

Accepted Solution

by:
rockiroads earned 150 total points
ID: 11716346
say your table is called xxx

select count(FileNumber) from xxx a where validated=false and recordid not in (select recordid from xxx where xxx.filenumber = a.filenumber and validated=true)


0
 
LVL 8

Expert Comment

by:arcross
ID: 11716359
SELECT * FROM yourtablename WHERE [FileNumber] = TRUE
0
 
LVL 8

Expert Comment

by:arcross
ID: 11716374
im crap. forget my comment. I had a brain attack
0
How Blockchain Is Impacting Every Industry

Blockchain expert Alex Tapscott talks to Acronis VP Frank Jablonski about this revolutionary technology and how it's making inroads into other industries and facets of everyday life.

 
LVL 8

Expert Comment

by:arcross
ID: 11716490
select  count(FileNumber) as  MyFileNumber from table1 WHERE FileNumber = TRUE and Validate=FALSE
0
 
LVL 35

Author Comment

by:YZlat
ID: 11716543
arcross, que pasa contigo?:)

rockiroads,

filenumber needs to be unique, so I changed your query to:

select count(FileNumber) from xxx a where validated=false and FileNumber not in (select distinct FileNumber from xxx where xxx.filenumber = a.filenumber and validated=true)



0
 
LVL 8

Expert Comment

by:arcross
ID: 11716661
jaja veo que controlas español YZlat
0
 
LVL 65

Expert Comment

by:rockiroads
ID: 11716683
onions, thats the only spanish I know (sorry bad joke)

and one other line, which a mexican friend of mine told me

chupa me ver..... thats enough now

sorry people, my spanish aint that good
0
 
LVL 8

Expert Comment

by:arcross
ID: 11716781
jajaja was he your real friend?

hmmm, or maybe (HE) was (SHE) what it makes the difference ;)
0
 
LVL 35

Author Comment

by:YZlat
ID: 11717006
yo creo que no:)
0
 
LVL 65

Expert Comment

by:rockiroads
ID: 11717177
his name was Ernie, I know him when I used to stay in Banning in California (at school) one of the first guys I got to know when I started school there

he did tell me the meaning and also another slight variation to it, but thats it

0
 
LVL 35

Author Comment

by:YZlat
ID: 11718590
that's how I learned:)
0

Featured Post

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

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

Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
If you need a simple but flexible process for maintaining an audit trail of who created, edited, or deleted data from a table, or multiple tables, and you can do all of your work from within a form, this simple Audit Log will work for you.
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

705 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