0

I have a table of withdrawal requests that has a datetime field called 'create_date'

I need to query that table to see if a member has submitted a withdrawal request within the past 24 hours

If they have, I need just the most recent record within 24 hours that matches their member ID.

any suggestions.
I thought it was something like this, but it isn't working.

  SELECT wthd_id, gross, net, create_date
  FROM withdraw_recs
  WHERE mem_id = '$member_id'
  AND create_date<=date_sub(now(), INTERVAL -24 hour)
  ORDER BY create_date desc
  LIMIT 1
2
Contributors
2
Replies
4
Views
4 Years
Discussion Span
Last Post by showman13
0

Yep... sure should... and it doesn't need the - in front of the 24...

Works perfectly.
Thanks

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.