It makes sense because I want all entries in the month no matter the
time. If there where no entries for a month I don't want the site to
display "no entries", I want it to display the entries for last month
that has entries. That way there will always be entries shown.


The below works.
SELECT     *
FROM         tbl_entries
WHERE     (MONTH(postDateTime) =
                          (SELECT     month(MAX(postdatetime))
                            FROM          tbl_entries)) AND
(YEAR(postDateTime) =
                          (SELECT     year(MAX(postdatetime))
                            FROM          tbl_entries))

-----Original Message-----
From: Schuster, Steven [mailto:[EMAIL PROTECTED]
Sent: Monday, January 05, 2004 1:34 PM
To: CF-Talk
Subject: RE: SQL: Selecting Max Date Entries

MAX of a date field to ignore time, why would you want it to do this?

That would be tricky, I guess you could trunc the date field or
something,
or use the format command.

But wouldn't you want the time piece in the comparison since 10/12/2004
at 3
PM is before 10/12/2004 at 5 PM? Excuse the stupid question just trying
to
understand...
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to