Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

24 Hour warning of data out of date

Status
Not open for further replies.

meltingpot

Technical User
May 11, 2004
118
GB
Our datadbase holds Date information that must be updated every 24:01. + 1 day

I want to have a warning on our internal web (ASP VB Script)page that gives a graphical warning that the date field have not been updated.

Simple query returns any boats that have a ‘PositionDate’ entry today, its text field.

SELECT *
FROM Boats INNER JOIN position ON Boats.HMSTC = position.BoatName
WHERE Boats.PostionDate=Date()

I need a piece of script that says that if there is no entry today, see if there is one for the day before and if so flag up an img showing a red cross, also if there is an entry for today then show a green tick img.


Ive no idea how to do this …

Help ?

Many Thanks
 
But what if nobody requests the web page for 3 days?
 
Its permenantly on disply on our 2 50inch screens - so no worries about access :)
 
Right but they will remain static unless there is some client-side code forcing them to request a refresh from the server.


Anyway, with regard to your original question, the best way is to query the server for the row with the most recent date. Then in your ASP you can use DateDiff() to see if 24 hours have passed between the most recent date and Now().
 
Yep the page refreshes every 20 minutes or so ...

Ok to query .

Each boat has a position posted once a day so we want a view of each boat and see if its PositionDate has been added to in the last day, 24 hours
 
I don't know your table structure but I was thinking something like this:
[tt]SELECT BoatID, Max(PostionDate) As 'LastDate'
FROM Boats GROUP BY BoatID[/tt]
 
Beautiful - I learn this stuff then forget how to use it ..

Ended as this

SELECT BoatName, Max(PositionDate) As 'LastDate'
FROM BoatPosition GROUP BY BoatName

Great stuff Many Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top