Page 1 of 1

DATETIME search - SOLVED

Posted: Thu Jun 22, 2006 11:45 am
by davidtee1
Hi group,

I have a database with a DATETIME field storing the timestamp when the record was created.

Records are added by a remote task from time to time.

I need a SELECT that can find all records created within the last 30 minutes. ie where "now() - timestamp <= 30 mins"

I can't figure out how so any help gratefully received.

Thanks,


David

Posted: Thu Jun 22, 2006 11:50 am
by RobertGonzalez
What DB are you using?

Posted: Thu Jun 22, 2006 11:51 am
by davidtee1
MySQL 4.1.15

Posted: Thu Jun 22, 2006 11:51 am
by feyd
DATEDIFF() and DATESUB() may be of interest.

Posted: Thu Jun 22, 2006 11:58 am
by davidtee1
Actually, TIMEDIFF is what I need. Thanks for the pointer...

D