Results 1 to 2 of 2

Thread: SQL Date function needed!!!

  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
    Fanatic Member Ianpbaker's Avatar
    Join Date
    Mar 2000
    Location
    Hastings
    Posts
    696

    Talking

    Hi Bebe Try This out

    SELECT testdate FROM tbltest WHERE DATEDIFF(hour,testdate,getdate()) <= 1

    Or

    SELECT testdate FROM tbltest WHERE DATEDIFF(minute,testdate,getdate()) <= 60


    Hope This Helps

    Ian

    [Edited by Ianpbaker on 05-26-2000 at 08:55 AM]
    Yeah, well I'm gonna build my own lunar space lander! With blackjack aaaaannd Hookers! Actually, forget the space lander, and the blackjack. Ahhhh forget the whole thing!

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