473,395 Members | 1,466 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.

Determining if data is consecutive in VB

cori25
83
I have a query which displays the employee name, month, date, exception. I need to have the query display when an employee has more then 7 consecutive days with a certain exception. Meaning the same employee name and month has to be >= 7 days which would be "Blocked" anything under this is "Intermittent". I though about and iif statement but it has to have the same employee name and month so I get thrown off.

Any ideas?

Thanks for the help!
Mar 24 '08 #1
7 1809
NeoPa
32,556 Expert Mod 16PB
If I suggest that you GROUP BY your [Name] and [Exception] fields then, in the WHERE clause play with Min(), Max() and Count() of the [Date] field, would that be enough to set you on the right track?
Mar 26 '08 #2
cori25
83
If I suggest that you GROUP BY your [Name] and [Exception] fields then, in the WHERE clause play with Min(), Max() and Count() of the [Date] field, would that be enough to set you on the right track?
I have already attempted the group by and min, max, count approach with no luck. I ws thinking more along the lines of having an IIF statement of some sorts, but it is a little tricky.

Thanks anyway...

I will continue trying to determine if this can be done

Thanks again
Cori
Mar 27 '08 #3
Google "data analysis" and "Ms Access." I came across some sharp code to do this yesterday, but don't remember where. I do recall that it was under "data analysis" though.
Mar 28 '08 #4
I think you can give it a try again with the Group By, Mix(), Max() method and with more than one Query. Use the above Query and take the Count() if days also.

Create a second Query using the above as source. Create a new column, say 7thDay:MixDate + 7 which will give you the exact 7th day date after the min() date. You have the count of Days too. If the count of days are less 7 but the Max() Date is more than the 7thDay Date then the values are not consecutive.

Give it a try on these lines.
Mar 28 '08 #5
NeoPa
32,556 Expert Mod 16PB
I think the last post is broadly on the right lines.

Look again and see what you can come up with.

Come back in a day or so if you really can't make it work. Hopefully by then I'll have a little more free time to be able to knock something up for you.
Mar 28 '08 #6
cori25
83
Thanks everyone for all the feedback! I actually got it to work by using an IIF statement to look st anything with more then 56 hours per month(seven 8 hour days).

Thanks again!
:)Cori
Mar 28 '08 #7
Could you please give more details on how you arrive at the result by using IIF() Function and 56 hrs of working. I am very much interested to know the technique that you have used to arrive at the result.

Thanks in advance.
Apr 15 '08 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: Adam | last post by:
Hi, I am trying to mark consective numbers in a data set and get a count as to how many consecutive numbers exist in the a given line of data. Here is an example line: 3, 5, 7, 9, 10, 13,...
18
by: Nitin | last post by:
Hi, Without using sizeof, is there a way to get to know the size of any data type on that OS ... ??? one way I could think of is to take diff of the addresses of two variables defined...
2
by: Beliavsky | last post by:
How can I replace multiple consecutive spaces in a file with a single character (usually a space, but maybe a comma if converting to a CSV file)? Ideally, the Python program would not compress...
7
by: Sharkie | last post by:
I need a regular expression which will evaluate to false if number of consecutive characters (non-whitespace) exceeds certain number (10 in this example). For example, I have this function: ...
6
by: cesco | last post by:
Hi, say I have a vector like the following: vec = and I'd like to know via a function (for example, ConsecutiveIntegers(vec, N)) whether there are N consecutive integers. So, for example,...
3
by: emeped | last post by:
I am using C#.NET 2003. Please I want to know if it is possible and how to insert the same data into 2 or more consecutive rows in a datatable column, at the same time, by a single click of a button....
23
by: tkpmep | last post by:
I have a list that starts with zeros, has sporadic data, and then has good data. I define the point at which the data turns good to be the first index with a non-zero entry that is followed by at...
16
by: sloan | last post by:
Current Framework 2.0/3.0. ... In Sql Server, there is a way to generate consecutive guid's. newsequentialid. Is there a way to reproduce this type of consecutive guid's in the framework.
8
by: gigonomics | last post by:
Hi all, I hope someone can help me out. I need to return the best available seats subject to the constraint that the seats are side by side (or return X consecutive records from a table column...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...

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.