SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Thread: SQL Date Query

  1. #1
    SitePoint Evangelist NokX's Avatar
    Join Date
    Feb 2003
    Location
    Knoxville, TN
    Posts
    523
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    SQL Date Query

    i'm wanting to determine if the current date/time falls between two dates in the database. i'm hoping this will work...

    SELECT * FROM tblTable WHERE {current date/time} BETWEEN Start AND End

    Start and End are formatted this way: 6/20/2005 11:29:23 AM

    any ideas?

  2. #2
    SitePoint Evangelist
    Join Date
    Apr 2005
    Location
    Moscow, Russia
    Posts
    557
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi, check for CURRENT_TIMESTAMP function (supported in both MySQL & MSSQL) or other proprietary functions of your DBMS that return current date-time


Bookmarks

Posting Permissions

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