Solved

Ensure fresh data

Posted on 2013-02-05
10
315 Views
Last Modified: 2013-02-07
I have table "TIger" that every minute imports new records from a .csv file.

I would like to test the data to ensure that it is current (within the last 30 minutes) based on fields "obs_date" and "obs_time", which are a medium time, and short date field (respectively).

If the data is older than 15 minutes, I would like to pop up a message box that states: "Reset link software immediately".

added bonus: The message box should close after 5 minutes if not acknowledged; that way if the software gets reset while I'm not at the database computer, we can continue processing.

If the solution involves vba, please include at the bottom how to call it from a macro.  I will be running the macro every few minutes.

Thank you!
0
Comment
Question by:TIgerV
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
10 Comments
 
LVL 40

Expert Comment

by:als315
ID: 38858138
Where are your fieds ("obs_date" and "obs_time")? In database or in csv? If in csv, upload sample file.
0
 

Author Comment

by:TIgerV
ID: 38858842
In the database.  Imported to the table.
0
 
LVL 47

Accepted Solution

by:
Dale Fye (Access MVP) earned 500 total points
ID: 38858977
Assuming this data is going to some sort of staging table, I would add some code similar to the following to your upload process, immediately after the upload.
Dim strCriteria as string

strCriteria = "DateValue([Obs_Date]) + timeValue([ObsTime]) < #" & DateAdd("n", -15, Now()) & "#"
if DCount("Obs_Date", "staging table", strCriteria) > 0 then
    
     DoCmd.Openform "frmWarning",,,,,acDialog

EndIf 

Open in new window

Note, you cannot use a MsgBox command to display your message as there is no way to programmatically close a messagebox.  Instead, create your own form (frmWarning) which has a TimerInterval of 300000 (5 minutes) and has Timer event code that will close the form after 5 minutes.
0
Forrester Webinar: xMatters Delivers 261% ROI

Guest speaker Dean Davison, Forrester Principal Consultant, explains how a Fortune 500 communication company using xMatters found these results: Achieved a 261% ROI, Experienced $753,280 in net present value benefits over 3 years and Reduced MTTR by 91% for tier 1 incidents.

 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 38859970
Why not just "Link" to the CSV file...

Then you won't have to bother with all the overhead of "Importing" the file over and over and over...

Then you can set the refresh rate in conjunction with perhaps re querying the form.

JeffCoachman
0
 

Author Comment

by:TIgerV
ID: 38861916
The file is refreshed with new data every minute.  I'm trying to collect that data every few minutes to get a sample over time.

5:38p,02/06/13,31.6,31.2,27.6, 73,30.303,Steady,5.2,SSE, 5.2, 5.2, 5.4, 9

It's time, date, temperature values (x4), pressure, flow speed, flow direction and then 3 values for high flow over 1, 2, 5 and 10 minutes.

I want to capture that data occasionally, and maintain a log that watches for certain values to be out of tollerance.  Importing and adding a line every few minutes is pretty easy and allows me to go back and see if we missed a time that temperatures/flow were out of tollerance.

So, I need to take the 5:38p temperature (31.6c) and compare it to the highest flow speed over 10 minutes (9ips).  If the temp is high, the flow can be faster, if the temp is low, the flow must be slower or it cools to fast.

Sometimes, the floor calls and says "Yesterday's batch was too cold"; and I can go back and look at the values presented to see where/when the problem was, or if they just sat on it too long.

I combine this with the output of our other monitoring system, as well, to ensure we're getting the same values and nothing is out of tune.

On occasion, the software running the sensors malfunctions, and I need to restart it.  Right now, there is no way to tell if it failed unless i come in. End result here is that I will just send a restart command if the import fails, but a text box for now is good.
0
 

Author Comment

by:TIgerV
ID: 38861933
The reason I have the 1, 2, 5, 10 minute history is because when the software restarts, it 0s out those values and the system would alarm on 0, so I take the lowest of the values above '0' for my sample if a data point is missing.
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 38862487
Did you read my suggestion about linking to the CSV file?


I seem to be confused, ...what is your one question here...?
How to refresh the data or creating "Historical" snapshots of the data.

JeffCoachman
0
 

Author Comment

by:TIgerV
ID: 38862497
My question was about checking dAte and time....
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 38862524
0
 

Author Closing Comment

by:TIgerV
ID: 38863701
Thank You!
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microsoft Office Picture Manager is not included in Office 2013. This comes as a shock to users upgrading from earlier versions of Office, such as 2007 and 2010, where Picture Manager was included as a standard application. This article explains how…
How to get Spreadsheet Compare 2016 working with the 64 bit version of Office 2016
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

735 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question