Advertisement

09.12.2008 at 03:50AM PDT, ID: 23725904
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

9.7

Access to the millisecond (article). Examples?

Asked by cactus_data in Access Coding/Macros, Microsoft Access Database

Tags: ,

Ever wondered if it can be done? It can.

The idea came one day where I wondered why SQL Server presents a time resolution of 3 ms while Access/VBA/JET only offers 1000 ms, both using the same underlying data type of double. So what was the resolution of double really? Much to my surprise, I found out that the resolution is 1 ms (or better) in the full range of data type date/time - from 100-1-1 00:00:00.000 to 9999-12-31 23.59.59.999.

Then I created the functions needed to generate and read time values with milliseconds and to create a set of functions handling milliseconds that mimic the full range of the well-known date/time functions of Access/VBA. One of the challenges was to get the calculations with doubles right avoiding bit errors. This was solved by switching to data type decimal at some critical places.

Finally Susan Harkins wrote it up. So (shameless plug):

  http://www.devx.com/dbzone/Article/39046

Below is the list of functions.

Anyone having a good example for practical use of milliseconds?

/gustav

Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
Msec() is the core function. It generates the current time with millisecond resolution and returns current (local) date/time, including millisecond. 
DatePartMsec() extracts milliseconds or decimal seconds, as well as all the standard date/time parts from a date/time value. 
DateAddMsec() adds milliseconds or decimal seconds, as well as all the standard date/time intervals to a date/time value. 
DateDiffMsec() calculates the difference in milliseconds or decimal seconds between two date/time values. 
MsecDiff() returns the difference in milliseconds between two date/time values. 
TimeMsec() returns current (local) date/time, including millisecond as a time value that includes milliseconds. 
NowMsec() returns current (local) date/time, including millisecond as a full date/time value that includes milliseconds. 
TimerMsec() returns count of seconds from midnight with millisecond resolution. 
Millisecond() returns the millisecond part from a date/time value. 
SecondMsec() returns the second and the millisecond from a date/time value as a decimal value. 
MsecSerial() returns the date/time value of a numeric (double) input rounded to integer milliseconds relative to a base date. 
TimeSerialMsec() returns the date/time value of the combined parameters for hour, minute, second, and millisecond. 
MsecValueMsec() extracts the millisecond time part from a string expression. 
ExtractMsec() returns millisecond the date/time value from the last digits of a string. 
CDateMsec() converts a date/time expression including millisecond to a date/time value. 
CVDateMsec() converts a date/time expression including millisecond or a number to a date/time value. 
IsDateMsec() checks an expression if it represents a date/time value with or without a millisecond part. 
DateValueMsec() cleans a string for a time part including milliseconds. It also returns the date value of the string. 
TimeValueMsec() cleans a string for a millisecond part. 
StrDateFull() returns a date/time value formatted as to the current settings for Short Date and Long Time with trailing milliseconds formatted as a fixed-length numeric string. 
StrDateMsec() returns milliseconds of a date/time value as a "000" formatted string. 
FormatMsec() returns a value as a string formatted with milliseconds or any other value using Format. 
StrDateIso8601Msec() returns a value as a string formatted with milliseconds according to ISO-8601. 
DateSumDates() adds or subtracts partial date/time values to create a compound date value. 
TimeSerialFull() returns correct numeric negative date/time values, which TimeSerial() does not. 
DateValid() returns invalid numeric negative date/time values less than one day as their positive equivalents. 
DateLinear() converts a native date/time value and returns the linear date value. 
DateNative() converts a linear date value and returns the native date value. 
DateMsecSet() rounds off a date/time value to the second and optionally adds specified millisecond part up to and including 999 milliseconds. 
SplitDateMsec() splits a date/time value into its components of date/time and millisecond as date/time values. 
JoinDateMsec() joins an array of date/time and millisecond as date/time values to a compound date/time value. 
DateSort() returns a continuous value including milliseconds that can be sorted on correctly even for negative date values. 
DateTimeRound() returns a date/time rounded off to the second by removing a millisecond portion. 
DateTimeRoundMsec() returns a date/time value rounded to the nearest millisecond approximately by 4/5.
 
Loading Advertisement...
 
[+][-]09.12.2008 at 03:58AM PDT, ID: 22458517

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Access Coding/Macros, Microsoft Access Database
Tags: Access, VBA
Sign Up Now!
Solution Provided By: peter57r
Participating Experts: 2
Solution Grade: A
 
 
[+][-]09.12.2008 at 08:58AM PDT, ID: 22461099

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]09.13.2008 at 10:55AM PDT, ID: 22468506

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09.13.2008 at 10:59AM PDT, ID: 22468535

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628