Home | Index | Dotnet4all Snippets | Submit resources
About | Mail us 
Find Missing Data (Monday, January 30, 2006)



Found the following interesting discussion in the Newsgroups:

Find Missing Data
by:Justin Emlay

I'm hopping someone can help me out on a payroll project I need to
implement.

To start we are dealing with payroll periods. So we are dealing with an
exact 10 days (Monday - Friday, 2 weeks).

I have a dataset as follows (1 week to keep it short):

Employee 1 - Date 1
Employee 1 - Date 2
Employee 1 - Date 3
Employee 1 - Date 4
Employee 1 - Date 5
Employee 2 - Date 1
Employee 2 - Date 3
Employee 2 - Date 4
Employee 2 - Date 5

You'll notice Employee 2 - Date 2 is missing. I need to develop a routine
that will give me all missed dates per employee.

I'm open to any ideas/theories. I have one of my own but before I get
started on it I wanted some opinions on it. I'm not sure how productive
such a routine will be. It sounds like a cluster f. to me.
Create an array of unique employee numbers

then

Loop
through that array and create a second array of unique dates. If the ubound
of that second array is < 9 then figure out missed date(s) (I have period
start). Dump employee number and date into a third array. Destroy second
array.
Next
Thoughts?


 Reply:
by:Cor Ligthert

 Hi Justin,

I assume every date is a row.

Seeing this than there are two question, you want to know if there are dates
missing, that is easy, you set them employee by employee in a dataview, the
count should always be 10.

Than you can show which dates are there, it should than for every programmer
be very easy to know what is missing.

(I would first make an array with dates which should be and test when there
is a missing one. The array because you have to deal with weekends which can
make it complex when you do it in a direct routine calculating everytime the
dates)

I assume that you do not have to test on doubles, which is of course with
that dataview as well a piece of cake.

Or do I see this the simple?

Cor



Posted by Xander Zelders



0 Comments:

Post a Comment

<< Home

 
Previous Posts
    - Dateformat on databound textboxes?
    - Moveable Toolbars
    - Help with hiding LinkButton in DataList
    - Project converted from VB6 to VB.Net gets subclass...
    - .Net says I'm not Online, but I am!
    - Freeware/shareware Windows controls
    - Combobox in datagrid?
    - To parenthesize or not... Bug in VB.Net?
    - How to change the Color of a Toolbar?
    - How to pass Objects as type System.Object?



Disclaimer & Terms of Use | DotNet4All.Com concept & © 2004 - 2007 by Zelders² - Holland