I have a database with records that should have a consecutive number
ID (Check Register). Also has other records (deposits and adjusting
entries) that don't fit in the number range so autonumbering isn't the
answer. I want to check to see if any check numbers are missing from
the register, but can't figure out how to accomplish it. Thanks for
any help. 6 4627
1. Build a table of numbers that starts with the first check# in the checking
account and goes to what you anticipate will be the highest check number ever
used in the account. You can easily generate the numbers in Excel and then
import into an Access table.
2. Build a query named QryAllPossibleC heckNum based on the numbers table and in
the numbers field enter the criteria:
Between XXXStartCheckNu m And XXX EndCheckNum
3. Build a query named QryCheckNumOfPo stedCheck and in the CheckNum field enter
the criteria:
Between XXXStartCheckNu m And XXX EndCheckNum
Note: You will have to determine how to write the actual criteria based on
where you get the first and last check#s.
4. At the database window, at the query tab, click on New. One of the options
will be Find Unmatched Query. Use this wizard to find the numbers in
QryAllPossibleC heckNum that are not in (unmatched) QryCheckNumOfPo stedCheck.
This new query will return all missing check numbers.
--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications re******@pcdata sheet.com www.pcdatasheet.com
"GSpiggle" <ga***@yahoo.co m> wrote in message
news:de******** *************** ***@posting.goo gle.com... I have a database with records that should have a consecutive number ID (Check Register). Also has other records (deposits and adjusting entries) that don't fit in the number range so autonumbering isn't the answer. I want to check to see if any check numbers are missing from the register, but can't figure out how to accomplish it. Thanks for any help.
Thanks PCDatasheet. Have done something similar in the past, but
thought there might be a function or code that I had missed.
Appreciate the response.
"PC Datasheet" <sp**@nospam.sp am> wrote in message news:<BP******* **********@news read3.news.atl. earthlink.net>. .. 1. Build a table of numbers that starts with the first check# in the checking account and goes to what you anticipate will be the highest check number ever used in the account. You can easily generate the numbers in Excel and then import into an Access table.
2. Build a query named QryAllPossibleC heckNum based on the numbers table and in the numbers field enter the criteria: Between XXXStartCheckNu m And XXX EndCheckNum
3. Build a query named QryCheckNumOfPo stedCheck and in the CheckNum field enter the criteria: Between XXXStartCheckNu m And XXX EndCheckNum
Note: You will have to determine how to write the actual criteria based on where you get the first and last check#s.
4. At the database window, at the query tab, click on New. One of the options will be Find Unmatched Query. Use this wizard to find the numbers in QryAllPossibleC heckNum that are not in (unmatched) QryCheckNumOfPo stedCheck. This new query will return all missing check numbers.
-- PC Datasheet Your Resource For Help With Access, Excel And Word Applications re******@pcdata sheet.com www.pcdatasheet.com "GSpiggle" <ga***@yahoo.co m> wrote in message news:de******** *************** ***@posting.goo gle.com... I have a database with records that should have a consecutive number ID (Check Register). Also has other records (deposits and adjusting entries) that don't fit in the number range so autonumbering isn't the answer. I want to check to see if any check numbers are missing from the register, but can't figure out how to accomplish it. Thanks for any help.
Thanks for the courtesy of a thank you!!
Steve
"GSpiggle" <ga***@yahoo.co m> wrote in message
news:de******** *************** ***@posting.goo gle.com... Thanks PCDatasheet. Have done something similar in the past, but thought there might be a function or code that I had missed. Appreciate the response.
"PC Datasheet" <sp**@nospam.sp am> wrote in message
news:<BP******* **********@news read3.news.atl. earthlink.net>. .. 1. Build a table of numbers that starts with the first check# in the
checking account and goes to what you anticipate will be the highest check number
ever used in the account. You can easily generate the numbers in Excel and then import into an Access table.
2. Build a query named QryAllPossibleC heckNum based on the numbers table
and in the numbers field enter the criteria: Between XXXStartCheckNu m And XXX EndCheckNum
3. Build a query named QryCheckNumOfPo stedCheck and in the CheckNum field
enter the criteria: Between XXXStartCheckNu m And XXX EndCheckNum
Note: You will have to determine how to write the actual criteria based on where you get the first and last check#s.
4. At the database window, at the query tab, click on New. One of the
options will be Find Unmatched Query. Use this wizard to find the numbers in QryAllPossibleC heckNum that are not in (unmatched) QryCheckNumOfPo stedCheck. This new query will return all missing check numbers.
-- PC Datasheet Your Resource For Help With Access, Excel And Word Applications re******@pcdata sheet.com www.pcdatasheet.com "GSpiggle" <ga***@yahoo.co m> wrote in message news:de******** *************** ***@posting.goo gle.com... I have a database with records that should have a consecutive number ID (Check Register). Also has other records (deposits and adjusting entries) that don't fit in the number range so autonumbering isn't the answer. I want to check to see if any check numbers are missing from the register, but can't figure out how to accomplish it. Thanks for any help.
It's a bit late for the original poster perhaps, but the following can also
be used:
Table: Ones
Field: Ordinal
Values: 0 - 9 (10 rows)
Table: CheckRegister
Field: CheckID
Values: 1117658 to 1117698 with a few deletions.
Query:
SELECT N.L AS Missing
FROM CheckRegister RIGHT JOIN [SELECT
111*10^4+[O3].[Ordinal]*10^3+[O2].[Ordinal]*10^2+[O1].[Ordinal]*10+[O0].[Ord
inal] AS L
FROM Ones AS O0, Ones AS O1, Ones AS O2, Ones AS O3
WHERE
(((111*10^4+[O3].[Ordinal]*10^3+[O2].[Ordinal]*10^2+[O1].[Ordinal]*10+[O0].[
Ordinal]) Between 1117658 And 1117698))]. AS N ON CheckRegister.C heckID =
N.L
WHERE (((CheckRegiste r.CheckID) Is Null));
The "Ones" have only a Cartesian join. This creates for seven places a
rather large initial resultset, requiring many seconds. So the generated
number has been shortened to 4 digits, with the common "111" set as a
constant value. The above takes less than a second to run (1.2GHz).
Clive
"PC Datasheet" <sp**@nospam.sp am> wrote in message
news:oJ******** *********@newsr ead2.news.atl.e arthlink.net... Thanks for the courtesy of a thank you!!
Steve
"GSpiggle" <ga***@yahoo.co m> wrote in message news:de******** *************** ***@posting.goo gle.com... Thanks PCDatasheet. Have done something similar in the past, but thought there might be a function or code that I had missed. Appreciate the response.
"PC Datasheet" <sp**@nospam.sp am> wrote in message news:<BP******* **********@news read3.news.atl. earthlink.net>. .. 1. Build a table of numbers that starts with the first check# in the checking account and goes to what you anticipate will be the highest check
number ever used in the account. You can easily generate the numbers in Excel and
then import into an Access table.
2. Build a query named QryAllPossibleC heckNum based on the numbers
table and in the numbers field enter the criteria: Between XXXStartCheckNu m And XXX EndCheckNum
3. Build a query named QryCheckNumOfPo stedCheck and in the CheckNum
field enter the criteria: Between XXXStartCheckNu m And XXX EndCheckNum
Note: You will have to determine how to write the actual criteria
based on where you get the first and last check#s.
4. At the database window, at the query tab, click on New. One of the
options will be Find Unmatched Query. Use this wizard to find the numbers in QryAllPossibleC heckNum that are not in (unmatched)
QryCheckNumOfPo stedCheck. This new query will return all missing check numbers.
-- PC Datasheet Your Resource For Help With Access, Excel And Word Applications re******@pcdata sheet.com www.pcdatasheet.com "GSpiggle" <ga***@yahoo.co m> wrote in message news:de******** *************** ***@posting.goo gle.com... > I have a database with records that should have a consecutive number > ID (Check Register). Also has other records (deposits and adjusting > entries) that don't fit in the number range so autonumbering isn't
the > answer. I want to check to see if any check numbers are missing
from > the register, but can't figure out how to accomplish it. Thanks for > any help.
"CDB" <al***@delete.w ave.co.nz> wrote in message news:<c5******* ***@news.wave.c o.nz>... It's a bit late for the original poster perhaps, but the following can also be used:
Table: Ones Field: Ordinal Values: 0 - 9 (10 rows)
Table: CheckRegister Field: CheckID Values: 1117658 to 1117698 with a few deletions.
Query: SELECT N.L AS Missing FROM CheckRegister RIGHT JOIN [SELECT 111*10^4+[O3].[Ordinal]*10^3+[O2].[Ordinal]*10^2+[O1].[Ordinal]*10+[O0].[Ord inal] AS L FROM Ones AS O0, Ones AS O1, Ones AS O2, Ones AS O3 WHERE (((111*10^4+[O3].[Ordinal]*10^3+[O2].[Ordinal]*10^2+[O1].[Ordinal]*10+[O0].[ Ordinal]) Between 1117658 And 1117698))]. AS N ON CheckRegister.C heckID = N.L WHERE (((CheckRegiste r.CheckID) Is Null));
The "Ones" have only a Cartesian join. This creates for seven places a rather large initial resultset, requiring many seconds. So the generated number has been shortened to 4 digits, with the common "111" set as a constant value. The above takes less than a second to run (1.2GHz).
Wow. Or, you could write a few lines of code:
sub showmissing()
dim rst as recordset
dim intStart as integer
dim intEnd as integer
dim i as integer
set rst = currentdb.openr ecordset("mytab le", dbopendynaset)
for i = intStart to intEnd
rst.findfirst "CheckID = " & i
if rst.nomatch then debug.print "CheckID ";i;" not found."
next i
end sub
rst.close
Bruce, you are quite right, of course, but you understate your case
somewhat.
I avoid using code in an RDB if tables and queries will do the job.
My solution can be modified to run as a stored proc in SQLServer - no front
end activity.
My resultset can be used "as is" to source a form for the user. (Your code
requires more lines to get to that stage.)
Your code needs fixing and extending to bring it to a commercial level.
(More code, more lines.)
The posting was more of an illustration of creating a sequence of numbers in
SQL, rather than using the first responder's suggestion of a table with
"all" the required numbers. I use the n*10^x approach regularly eg for users
to "add a year of days" to a business calendar.
With all due deference to the ancient wise...
Clive
"Bruce" <br***@aristotl e.net> wrote in message
news:d3******** *************** ***@posting.goo gle.com... "CDB" <al***@delete.w ave.co.nz> wrote in message
news:<c5******* ***@news.wave.c o.nz>... It's a bit late for the original poster perhaps, but the following can
also be used:
Table: Ones Field: Ordinal Values: 0 - 9 (10 rows)
Table: CheckRegister Field: CheckID Values: 1117658 to 1117698 with a few deletions.
Query: SELECT N.L AS Missing FROM CheckRegister RIGHT JOIN [SELECT
111*10^4+[O3].[Ordinal]*10^3+[O2].[Ordinal]*10^2+[O1].[Ordinal]*10+[O0].[Ord inal] AS L FROM Ones AS O0, Ones AS O1, Ones AS O2, Ones AS O3 WHERE
(((111*10^4+[O3].[Ordinal]*10^3+[O2].[Ordinal]*10^2+[O1].[Ordinal]*10+[O0].[ Ordinal]) Between 1117658 And 1117698))]. AS N ON CheckRegister.C heckID
= N.L WHERE (((CheckRegiste r.CheckID) Is Null));
The "Ones" have only a Cartesian join. This creates for seven places a rather large initial resultset, requiring many seconds. So the generated number has been shortened to 4 digits, with the common "111" set as a constant value. The above takes less than a second to run (1.2GHz).
Wow. Or, you could write a few lines of code:
sub showmissing()
dim rst as recordset dim intStart as integer dim intEnd as integer dim i as integer
set rst = currentdb.openr ecordset("mytab le", dbopendynaset)
for i = intStart to intEnd rst.findfirst "CheckID = " & i if rst.nomatch then debug.print "CheckID ";i;" not found." next i
end sub rst.close This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: PhilC |
last post by:
Hi Folks,
If I have an array holding a pair of numbers, and that pairing is
unique, is there a way that I can find the array index number for that
pair?
Thanks,
PhilC
|
by: peterbe |
last post by:
In a text that contains references to numbers like this: #583 I want to
find them with a regular expression but I'm having problems with the
hash. Hopefully this code explains where I'm stuck:
>>> import re
>>> re.compile(r'\b(\d\d\d)\b').findall('#123 x (#234) or:#456 #6789')
>>> re.compile(r'\b(X\d\d\d)\b').findall('X123 x (X234) or:X456 X6789')
>>> re.compile(r'\b(#\d\d\d)\b').findall('#123 x (#234) or:#456 #6789')
|
by: GSpiggle |
last post by:
I have a database with records that should have a consecutive number
ID (Check Register). Also has other records (deposits and adjusting
entries) that don't fit in the number range so autonumbering isn't the
answer. I want to check to see if any check numbers are missing from
the register, but can't figure out how to accomplish it. Thanks for
any help.
|
by: someone else |
last post by:
hi all
I'm a newbie to this group. my apologies if I break any rules.
I've wrote a simple program to find the first 1,000,000 primes, and to find
all primes within any range (up to 200 * 10^12)
it's pretty efficient, it took 15 minutes to compute the first 1,000,000
primes.
|
by: Kamran K |
last post by:
Hello
I have created a client server application using C#. Existing
application is using random number on client side to generate sequence
numbers that are then assigned to transactions. This results in
duplicate sequence numbers across multiple users.
Solution to this problem is to generate the sequence number on the
server. Since this is not an ASP app, I cannot use Global.asax
Application object to keep track of begin application.
| |
by: Eric E |
last post by:
Hi,
I have a question about sequences. I need a field to have values with
no holes in the sequence. However, the values do not need to be in order.
My users will draw a number or numbers from the sequence and write to
the field. Sometimes, however, these sequence numbers will be discarded
(after a transaction is complete), and thus available for use. During
the transaction, however, any drawn numbers need to be unavailable.
I would...
|
by: athiane |
last post by:
I want a way to parse out all function names that appear in a couple of
C files.
When the parsing logic finds a function name in a file, it should print
out the Function name, line number and file in which the Function was
found.
What approach should i follow to tackle this problem ?
Is there any option in the gcc compiler that prints out this
information ?
|
by: raylopez99 |
last post by:
Here is a short program demonstrating using IEnumberable, Linq,
predicates, extension methods and some tricks and how to convert an
IEnumberable sequence into an array.
For future reference, not intended as a question.
RL
Main():
int numbers = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,11};
|
by: Slaunger |
last post by:
Hi all,
I am a Python novice, and I have run into a problem in a project I am
working on, which boils down to identifying the patterns in a sequence
of integers, for example
..... 1 6 6 1 6 6 1 6 6 1 6 6 1 6 6 1 9 3 3 0 3 3 0 3 3 0 3 3 0 10 6 6
1 6 6 1 6 6 1 6 6 1 6 6 1 6 6 1 6 6 1 9 3 3 0 3 3 0 3 3 0 3 3 0 10 6 6
1 6 6 1 6 6 1 6 6 1 6 6 1 6 6 1 6 6 1 9 3 3 0 3 3 0 3 3 0 3 3 0 10 6 6
1 6 6 1 6 6 1 6 6 1 6 6 1 6 6 1 6 6 1 9 3 3 0 3 3 0...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
| |
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |