p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

proasp_codeclinic thread: Using Date for record count


Message #1 by "Richard" <asp@h...> on Tue, 8 May 2001 18:21:02
If you use Access db, it is similar:
objCmd.CommandText="SELECT COUNT(*) AS RecCt FROM Item WHERE
 datediff("d",requestdate, date())=0".
> I am using an Access db.
> I ended up with this line:
>  objCmd.CommandText="SELECT COUNT(*) AS RecCt FROM Item WHERE (date() 
> - completedate)<1"
> This gives me all the records from the last 24 hours, but I would still 
rather have 
> them as just from today.
> Thanks
> 
> > If you use SQL Server datbase, you can use this SQL:
> > objCmd.CommandText="SELECT COUNT(*) AS RecCt FROM Item WHERE
> > datediff(day,requestdate, getdate())=0".
> > Please try and let me know result.

  Return to Index