T
Tech Geek 1234
I have posted this under Access Queries, and now feel the Programming group
is more applicable. Below is the basis of my challenge at this point.
The bottom line of what I need is to be able to query a set of records for
the past 30 days, based on UTC time, not "Now()" time. I have a series of
queries that provide me with the totals I need, but they currently all use
the "Now()" function in their calculations.
I am familiar with the "GetSystemTime" function for VB Access (which returns
the date and time in UTC.) But I'm unable to get it and use it in my
queries. (I've tried putting it in a form field and referencing it in place
of the "Now()" in my criteria parameters, but Access gives me "too complex"
errors. e.g.
">=([Forms]![MainForm].[FeasibilityForm].[form].[txtCurrentTime])-30").
Others have pointed me to a code called "GetTimeZoneBias", but I don't see
how that solves this problem as I already have the UTC time - but only in a
form, not the query where I need it.
Is it possible (and feasible) to use code to return the results rather than
a query? I have several queries. One set of queries filters the results by
past 24 hours, 30 days and 90 days. The next set sums the filter queries to
give me a total number. The last query summarizes everything and gives me
the totals of each for a specific person, (e.g. they flew 4 hours in the past
24 hours, 45 hours in the past 30 days, and landed 15 times in the past 90
days). If I can duplicate these queries/results in VB Code, then I should be
able to use UTC time instead of Now(). ????
Any thoughts and suggestions are appreciated. I need to find a way to pull
the records in an accurate time frame, and being off 4-5 hours is not
acceptable in this scenario.
Thanks!
is more applicable. Below is the basis of my challenge at this point.
The bottom line of what I need is to be able to query a set of records for
the past 30 days, based on UTC time, not "Now()" time. I have a series of
queries that provide me with the totals I need, but they currently all use
the "Now()" function in their calculations.
I am familiar with the "GetSystemTime" function for VB Access (which returns
the date and time in UTC.) But I'm unable to get it and use it in my
queries. (I've tried putting it in a form field and referencing it in place
of the "Now()" in my criteria parameters, but Access gives me "too complex"
errors. e.g.
">=([Forms]![MainForm].[FeasibilityForm].[form].[txtCurrentTime])-30").
Others have pointed me to a code called "GetTimeZoneBias", but I don't see
how that solves this problem as I already have the UTC time - but only in a
form, not the query where I need it.
Is it possible (and feasible) to use code to return the results rather than
a query? I have several queries. One set of queries filters the results by
past 24 hours, 30 days and 90 days. The next set sums the filter queries to
give me a total number. The last query summarizes everything and gives me
the totals of each for a specific person, (e.g. they flew 4 hours in the past
24 hours, 45 hours in the past 30 days, and landed 15 times in the past 90
days). If I can duplicate these queries/results in VB Code, then I should be
able to use UTC time instead of Now(). ????
Any thoughts and suggestions are appreciated. I need to find a way to pull
the records in an accurate time frame, and being off 4-5 hours is not
acceptable in this scenario.
Thanks!