473,395 Members | 2,443 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Whats missing from range of licenses?

I have a park permit tracking database where I was thinking of having
the user enter all the park permits individually, however realized
that in a day, a park could host many daily users. So if 100 daily
permits were issued, the data entry would consist of 100 entries with
only the permit number changing. If I changed the database to collect
beginning and ending permit number would I be able to find the missing
permit numbers? Say an example of entries where permit 1-40, 41-50,
52-55, 57-63 would I be able to find out that permit 51 and 56 were
missing short of creating a table with every possible permit number???
That just seems tedious.
Nov 12 '05 #1
5 1778
Instead, I would probably add a command button like "Issue a permit".
Once pressed, a new record is created with automatically incremented
permit number. If it needs to be changed, you could show it on your form
for editing. Also, if someone with an annual pass comes in, just scan
the pass' barcode and it would log itself in the database. Would this work?

Pavel

Annette Massie wrote:

I have a park permit tracking database where I was thinking of having
the user enter all the park permits individually, however realized
that in a day, a park could host many daily users. So if 100 daily
permits were issued, the data entry would consist of 100 entries with
only the permit number changing. If I changed the database to collect
beginning and ending permit number would I be able to find the missing
permit numbers? Say an example of entries where permit 1-40, 41-50,
52-55, 57-63 would I be able to find out that permit 51 and 56 were
missing short of creating a table with every possible permit number???
That just seems tedious.

Nov 12 '05 #2
The county park system has many individual parks and many park workers
who have their own books of permits. To have the program increment
won't really work because their could be any range of permits sold in
any given day at any location by any worker.
Nov 12 '05 #3
Well it's case of brute force and ignorance but if you're not dealing with
large numbers of permits then I'd be inclined to set up a FOR...NEXT loop
that starts at the lower permit number, works its way up to the highest
permit number, and checks each one against the table to see if it exists
(using a dynamic SQL statement). Something like:

For intCount = LowestPermit to HighestPermit
strSQL = "SELECT Count(*) As CountPermit FROM tbPermit WHERE PermitNo =
" & intCount
rsPermit.Open
strSQL,CurrentProject.Connection,adOpenForwardOnly ,adLockReadOnly,adCmdText
if rsPermit!CountPermit = 0 Then StoreThisNumberSomewhere() 'obviously
you'd have to code this function
rsPermit.Close
Next intCount

I'm willing to bet that some maths genius has come up with a more elegant
solution (I think you'd be hard pressed to find a less elegant solution!)
but as long as your permits stay below the hundred thousand level I can't
see too many problems occuring.

"Annette Massie" <an******@co.saint-croix.wi.us> wrote in message
news:c6**************************@posting.google.c om...
I have a park permit tracking database where I was thinking of having
the user enter all the park permits individually, however realized
that in a day, a park could host many daily users. So if 100 daily
permits were issued, the data entry would consist of 100 entries with
only the permit number changing. If I changed the database to collect
beginning and ending permit number would I be able to find the missing
permit numbers? Say an example of entries where permit 1-40, 41-50,
52-55, 57-63 would I be able to find out that permit 51 and 56 were
missing short of creating a table with every possible permit number???
That just seems tedious.

Nov 12 '05 #4
I guess in this case in order it is important for me to know how is the
data entry handled in the first place. Is it a back end with multiple
FEs connectsd, or do they send permit numbers in to a central location?
Recording ranges does not appeal to me. It does not optimize anything
much as opposed to recodring the numbers, and recording the ranges
definitely makes it more involved when it comes to data analyses.

Pavel

Annette Massie wrote:

The county park system has many individual parks and many park workers
who have their own books of permits. To have the program increment
won't really work because their could be any range of permits sold in
any given day at any location by any worker.

Nov 12 '05 #5
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Somebody else had a similar "brute-force" solution - here's another.
It's final result is a string of comma-delimited numbers representing
the missing permit numbers. You may wish to do something else w/
these numbers - you'll have to change the code to suit your purposes.

The Replace() function is not available in Acc97 and earlier versions.
There is a similar function in the Neat Code example database
available on the Microsoft download website (watch out for line-wrap):

http://support.microsoft.com/default.aspx?scid=kb;en
us;177972&Product=acc97

You'll have to change the SQL_PERMITS string to match your table/field
names.

You should put in error traps.

=== air code ===

Function MissingPermits() As String
' return a comma-delimited string of
' the missing permit numbers, on, or after,
' the indicated date

const SQL_PERMITS = "SELECT PermitNo " & _
"FROM Permits " & _
"WHERE PermitDate >= |1 " & _
"ORDER BY PermitNo"

dim db as dao.database
dim rs as dao.recordset
dim strSQL as string
dim strMissing as string
dim lngPrevious as long

' Put in the indicated date
' Using Acc2002
' If Replace function needed in Acc97 see
' ReplaceStr() in ntcode97.exe on MS download site.
strsql = Replace(SQL_COUNT,"|1","#1/1/2003#")

set db = currentdb
set rs = db.openrecordset(SQL_PERMITS)

' initialize - start w/ the 1st available no.
' assumes this no. is a "good" starting
' no. for the indicated date.
if not rs.eof then
lngPrevious = rs!PermitNo
rs.movenext
end if

do while not rs.eof
' iterate thru other records
' finding all missing permit nos.

if rs!PermitNo - 1 <> lngPrevious then
strMissing = strMissing & _
FillNumbers(lngPrevious, rs!PermitNo) & ","
Endif

lngPrevious = rs!PermitNo

rs.MoveNext

loop

' Get rid of trailing comma
if len(strMissing)>0 then
strMissing = Left$(strMissing,len(strMissing-1))
end if

MissingPermits = strMissing

End Sub

Function FillNumbers(lngStart as long, lngEnd As long) as string
' return a comma-delimited string of sequential numbers
' between lngStart and lngEnd range, excluding lngStart & lngEnd

dim i as long
dim strResults as string

for i = lngStart + 1 to lngEnd - 1
strResults = strResults & i & ","
next

' drop trailing comma
if len(strResults)>0 then
strResults = left$(strResults, len(strResults)-1)
end if

FillNumbers = strResults

End Function

== end air code ==
MGFoster:::mgf
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBP57drYechKqOuFEgEQJneQCgnXIvgmei8k5sc5tOFaw1P2 TM47wAoPAx
op7c+boR7M47MCVFPV2SrjX9
=pXRS
-----END PGP SIGNATURE-----

Annette Massie wrote:
The county park system has many individual parks and many park workers
who have their own books of permits. To have the program increment
won't really work because their could be any range of permits sold in
any given day at any location by any worker.


Nov 12 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Joanny | last post by:
Hi, there, When I open a VB6 application on VB.net, it automatically upgrade to VB.net. But I got the error message said: "Upgrade failed: Exception occurred: The referenced components...
0
by: kris | last post by:
hi can any one help me out, i have written a code for Word Indexing using Dll's i think this is an incomplete code for WORD INDEX. I had encountered this error "Error! No index entries found"...
5
by: Patrick.O.Ige | last post by:
What could cause the error:- System.NullReferenceException: Object reference not set to an instance of an object. Any ideas?
77
by: Ville Vainio | last post by:
I tried to clear a list today (which I do rather rarely, considering that just doing l = works most of the time) and was shocked, SHOCKED to notice that there is no clear() method. Dicts have it,...
67
by: PC Datasheet | last post by:
Transaction data is given with date ranges: Beginning End 4/1/06 4/4/06 4/7/06 4/11/06 4/14/06 4/17/06 4/18/06 4/21/06 426/06 ...
9
by: CoCoCha | last post by:
Hi, I am trying to run a simple macro in excel vba to create a new email and attach two spreadsheets. But it won't work. It stops at the first line everytime. Dim objOutlook As...
2
by: Joe Goldthwaite | last post by:
I've been playing with Python a bit. Doing little performance benchmarks and working with Psyco. It's been fun and I've been learning a lot. For example, in a previous post, I was looking for a...
4
by: =?Utf-8?B?VG9yZW4gVmFsb25l?= | last post by:
Was editing code, am getting the following errors } expected Type or namespace definition, or end-of-file expected Eyes crossed cannot find code below! using System; using...
4
by: (2b|!2b)==? | last post by:
template <typename T1, typename T2> struct MyDbInfo { MyDbInfo():m_pEnv(0), m_tran(0), m_db(0), m_idx(0) {} MyDbInfo(CDbEnv *env, DbTxn* tran, T1* db_ptr, T2 *idx_ptr):m_pEnv(env),...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
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,...
0
jinu1996
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...
0
tracyyun
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...
0
agi2029
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,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.