473,386 Members | 1,757 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,386 software developers and data experts.

VBA Access date time

I am new to VBA Access. I create "mytable" with 2 columns from existing main table by giving start date and end date.
Given below is mytable.
First column: dt( date hr:min:sec format )
Second column: string( the row elements could be true or false or none )
dt string
3/4/04 1:05:30 PM true
3/4/04 1:06:39 PM false
3/5/04 1:06:42 PM false
3/5/04 1:07:40 PM none
3/5/04 1:08:00 AM false
3/5/04 1:08:10 PM false
3/5/04 1:24:20 PM false
3/5/04 1:34:20 PM false
3/6/04 1:36:30 PM true
In the string column, the VBA code should look for "false". Look for a pattern where false is in continuous order like ( false2, false3 )
or (false5, false6, false7, false8) and increment the counter if the time difference (false3 - false2)>=200seconds or (false7-false5)>=200
or (false8 - false5)>= 200.
The output should give final value of counter and p = (counter/num)*100
In the above case, the output will be counter=3 because of (false6 - false5) ( false7 - false5 ) and (false8 - false5) and value of
p=(3/num)*100
num = datediff(false8 - false5)
Note: false2 means 2nd element in string column is false.If it would have been false5, false6 and false7 and then true8 then the counter should increment if (false7-false5)>=200seconds.

Output should be

Date counter p
3/4/04 0 0
3/5/04 3 (3/num)*100
3/6/04 0 0
If someone can implement this that will be great.
Thanks in advance.
Oct 24 '06 #1
0 1119

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

Similar topics

3
by: Jay | last post by:
I previously posted this question under Visual Basic newsgroup, but was advised to re-post here. I'm hoping someone can help me solve an issue I'm having with VB.Net and Access 2000. Here's...
1
by: mark | last post by:
In Access 2000 and 2002, I have created an import specification to import the fixed-width recordset below into an existing table. I am having strange problems with the import of the date and time...
4
by: bhbgroup | last post by:
I have a query on one large table. I only add one condition, i.e. a date (the SQL reads like 'where date > parameterdate'. This query is rather quick if 'parameterdate' is either explicitly...
3
by: cflarida | last post by:
I have a simple form that will gather it's information from a card reader. The form has 3 fields SSN which is gathered from the card swipe. Can I make access automaticly hit enter when it hits...
5
by: Henning M | last post by:
Hi all, I having some problems with Access and selecting records between dates.. When I try this in access, it works fine!! "Select * from Bilag Where Mdates Between #1/1/2006# And...
3
by: Jim in Arizona | last post by:
I have a gridview that's being populated from an access db query. The problem I'm having is that the date/time fields in access that are populating the gridview are showing both date and time, when...
3
by: Sheldon | last post by:
I have the following query expression - Like Format((!!)) & "/*/" & (! !) which would translate to e.g. 04/*/2007 if someone is running a report for last month. The above expression is part of a...
4
by: SilentThunderer | last post by:
Hey folks, Let me start out by letting you know what I'm working with. I'm building an application in VB 2005 that is basically a userform that employees can use to "Clock in". The form...
1
MMcCarthy
by: MMcCarthy | last post by:
Access has a number of built-in functions which can be generally used in queries or VBA code. Some of the more common ones are: Note: anything in square brackets is optional Date Functions ...
6
by: Mark | last post by:
Currently using MS Access 2000 and SQL Server Express. Using the current DAO OpenRecordset code listed below, however I keep getting the error message.... 3254: ODBC --Cannot lock all records ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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
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...

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.