Everyone,

I think I've got this licked on my own. Here's what I wound up with. Seems
to work ok.

select nodename, startdate, enddate
 from history
 where startdate >= concat(date_format(date_sub(now(), interval 1 day),
  '%y-%m-%d'), ' 07:00:00')
 and startdate <= concat(date_format(now(),'%Y-%m-%d'), ' 07:00:00')
 order by startdate;

This gets me everything between 7:00am yesterday and 7:00am today.

Thanks!

Don

-----Original Message-----
From: Gordon Stewart [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 25, 2002 9:08 AM
To: [EMAIL PROTECTED]
Subject: Re: Sql SELECT statement to get all dates between 7:00am
yesterday an d 7:00am today


At 08:22 25/04/02 -0500, you wrote:
>Hi Everyone,
>
>I am very new to database programming, and am working on an application
>where I need to select all records between yesterday at 7:00am and today at
>7:00am. Obviously this can be run at any time or day. This has to be a very
>common sql SELECT statement, but for the life of me I can't find anything.
>I'm either not doing the right google search or looking in the right
places.

Does one column  of your table contain the date/time of each record in your 
table ?

What format is the date/time in ?

G.


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail
<[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to