Results 1 to 2 of 2

Thread: Calculating Date using SQL?

  1. #1
    Join Date
    Feb 2004
    Posts
    1

    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

  2. #2
    Join Date
    Mar 2003
    Posts
    468
    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
  •