Results 1 to 3 of 3

Thread: SQL Database how do I get the current date back 60 minutes

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Mar 2000
    Location
    bebenia, PA, USA
    Posts
    241
    I need to take the current date and get a range between the current date and back 1 hour or 60 minutes using SQL and an SQL Database.

    Does someone have some sample code to show me please?

  2. #2
    PowerPoster BruceG's Avatar
    Join Date
    May 2000
    Location
    New Jersey (USA)
    Posts
    2,657
    How about:
    DateAdd("h", -1, Now)

  3. #3
    Lively Member
    Join Date
    Jan 2000
    Location
    Omaha, Ne
    Posts
    65

    Cool Between

    and then you take the value returned back from DateAdd and use it in your query:


    Select Bla from That where some_date between ThisDate and ThatDate

    or

    Select Bla from That where some_date >= ThisDate and some_date <= ThatDate


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width