Results 1 to 3 of 3

Thread: Today's Date?

  1. #1

    Thread Starter
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256

    Today's Date?

    What's wrong with this SQL statement?:

    Code:
    SELECT * FROM vbsPosts WHERE createdBy='Dave' AND createdOn = CURDATE()
    I want to select records that have field createdBy equal to Dave and field createdOn equal to today's date.
    My evil laugh has a squeak in it.

    kristopherwilson.com

  2. #2

    Thread Starter
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256
    Almost have it working with this:

    Code:
    SELECT * FROM vbsPosts WHERE createdBy='Dave' AND DATE_FORMAT(createdOn, '%Y-%m-%d') = CURDATE()
    My evil laugh has a squeak in it.

    kristopherwilson.com

  3. #3

    Thread Starter
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256
    Correction, it's working now with the above code.
    My evil laugh has a squeak in it.

    kristopherwilson.com

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