These things  may seem obvious, but its always the best place to start. Is 
the field in your table a date/time field. 

Also try this.... 

SQL="SELECT count (id) " & _
    "FROM post " & _
    "WHERE FormatDateTime(postdate,2) = #" & FormatDateTime(Date(),2) & "# 
"

response.write There were " & todaysposts & " posts today."

Also make sure you are ordering your sql statement when you are dong it 
live .... "ORDER BY PostDate DESC "

Soren








rickstahr <[EMAIL PROTECTED]>
09/30/2004 12:34 PM
Please respond to active-server-pages
 
        To:     [EMAIL PROTECTED]
        cc: 
        Subject:        [ASP] Help! Date functions


People post on my forum several times per day.
I log the date as postdate so I can show them in order.
The order of posts for a particular day were random... If I posted a 
second ago it could be lower than a post from this morning.

To Fix:

I changed how I store postdate from Date() to Now(), expecting the 
sort to look at time of day as well.

Now I have 2 problems: 

1. The posts are still in random order for the day
2. I try to count today's posts and come up with 0.

SQL="Select count (id) from post WHERE postdate =#" & Date() & "#"
todaysposts=poststoday(0)
response.write There were " & todaysposts & " posts today."

Please help! It's for http://www.vwsucks.com

thanks




--------------------------------------------------------------------- 
 Home       : http://groups.yahoo.com/group/active-server-pages
---------------------------------------------------------------------
 Post       : [EMAIL PROTECTED]
 Subscribe  : [EMAIL PROTECTED]
 Unsubscribe: [EMAIL PROTECTED]
--------------------------------------------------------------------- 
Yahoo! Groups Links



 




[Non-text portions of this message have been removed]



------------------------ Yahoo! Groups Sponsor --------------------~--> 
$9.95 domain names from Yahoo!. Register anything.
http://us.click.yahoo.com/J8kdrA/y20IAA/yQLSAA/17folB/TM
--------------------------------------------------------------------~-> 

---------------------------------------------------------------------    
 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/
 

Reply via email to