-
Calculating Date using SQL?
Hi everyone,
I have a database in which prices of stocks are stored daily. A program has been written to download the latest prices everyday and update the database with a timestamp stored as date stating when a price was last updated.
I would like to do a select statement which will show me all prices which havent had any new updates in the last 48 hours. How do I do this calculation on a date field using SQL?
Thanks, John
-
to check if a date of last updated is more than 48 hours old you could just compare the date to sysdate-2.
subtracting 2 from a date will take two days (48 hours) off of the time.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|