Question: I'm wondering if I'm using date/time fields correctly in the vb part of access. 
I have a date time field where for example 14th april 2016 is standing.
If the "Dauer" which is duration in seconds is > 6 hours then something should happen else something else.

Datum and Dauer are variables directly assigned via sql statement (select) from a table. Then I use both of them (DAtum is of type Date/Time and Dauer of type int).

```
 If (Datum >= "16.07.2015" And Dauer > (6 * 60 * 60)) Then   ' 6 Stunden

```

Like mentioned above I have the case that with 14th april 2016 and duration > 6 hours (6.19 for example). But somehow I still end up in the else part of the if so I'm guessing either I did something wrong with the "Datum" variable or I have a problem in between the assignement and the if (although I wouldn't see anything).

Thus my question is do I check the date/time field correctly this way? So that only >= 16th of July 2015 it is checked if Dauer is greater than 6 hours?

Answer: 
For future reference you might also think about using scipy.integrate. 
Look here [for some methods](http://docs.scipy.org/doc/scipy/reference/tutorial/integrate.html) which might have better accuracy depending on the nature and resolution of your data set.

A code might look like this:

```
import scipy.integrate as int
x = [ ii/10. for ii in range(21)]
y = [ xi**4 - 2*xi + 1 for xi in x]
tahdah = int.simps(y,x,even='avg')
print(tahdah)

```

Which yields and answer of 4.4 that you can confirm with pencil and paper.
Have you seen the [code example](https://en.wikipedia.org/wiki/Simpson%27s_rule#Sample_implementation) of Simpsons Rule on Wikipedia (written in python)? I will repost it here for the benefit of future readers.

```
#!/usr/bin/env python3
from __future__ import division  # Python 2 compatibility

def simpson(f, a, b, n):
    """Approximates the definite integral of f from a to b by the
    composite Simpson's rule, using n subintervals (with n even)"""

    if n % 2:
        raise ValueError("n must be even (received n=%d)" % n)

    h = (b - a) / n
    s = f(a) + f(b)

    for i in range(1, n, 2):
        s += 4 * f(a + i * h)
    for i in range(2, n-1, 2):
        s += 2 * f(a + i * h)

    return s * h / 3

# Demonstrate that the method is exact for polynomials up to 3rd order
print(simpson(lambda x:x**3, 0.0, 10.0, 2))       # 2500.0
print(simpson(lambda x:x**3, 0.0, 10.0, 100000))  # 2500.0

print(simpson(lambda x:x**4, 0.0, 10.0, 2))       # 20833.3333333
print(simpson(lambda x:x**4, 0.0, 10.0, 100000))  # 20000.0 

```