Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Ensure fresh data

Posted on 2013-02-05
10
Medium Priority
?
330 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 48

Accepted Solution

by:
Dale Fye earned 2000 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
Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

 
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Outlook for dependable use in a very small business   This article is about using the Outlook application (part of Microsoft Office) in a very small business, or for homeowners where dependability and reliability are critical requirements. This …
An alternative to the "For XML" way of pivoting and concatenating result sets into strings, and an easy introduction to "common table expressions" (CTEs). Being someone who is always looking for alternatives to "work your data", I came across this …
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …

636 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