Rick, I presume that now that you're using "NOW()" instead of "DATE()", you
will soon encounter another problem on the query below.
You have to use
BETWEEN DATE() and DateAdd("d",1,DATE())
or
BETWEEN DATE() and DATE() & "11:59 PM"
(the above in pseudo code for quick response, you'll need to get all the
formatting correct for your SQL statement)
Otherwise, it's only getting messages with no time on them.
----- Original Message -----
From: "rickstahr" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Tuesday, January 11, 2005 9:52 PM
Subject: [ASP] Count Today's Posts
>
>
> While we're on a roll here...
>
> I'd like to count today's posts - I've used
>
> "SELECT COUNT (*) FROM post WHERE postdate='" & Date() & "'"
> "SELECT COUNT (*) FROM post WHERE postdate=#" & Date() & "#"
> "SELECT COUNT (*) FROM post WHERE postdate='#" & Date() & "#'"
>
> then I tried output these ways
>
> GetTodaysPosts=conn.execute(SQL)
> response.write GetTodaysPosts(0)
>
> SELECT COUNT (*) FROM post as todaysposts WHERE postdate='#" & Date()
> & "#'"
> response.write todaysposts
>
> It's either 0 or blank. Dare I ask for help again?
>
>
>
>
>
> ---------------------------------------------------------------------
> Home : http://groups.yahoo.com/group/active-server-pages
> ---------------------------------------------------------------------
> Post : [email protected]
> Subscribe : [EMAIL PROTECTED]
> Unsubscribe: [EMAIL PROTECTED]
> ---------------------------------------------------------------------
> Yahoo! Groups Links
>
>
>
>
>
>
>
>
---------------------------------------------------------------------
Home : http://groups.yahoo.com/group/active-server-pages
---------------------------------------------------------------------
Post : [email protected]
Subscribe : [EMAIL PROTECTED]
Unsubscribe: [EMAIL PROTECTED]
---------------------------------------------------------------------
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/active-server-pages/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/