What I've done in the past is either asked the user for a date or date range, or I've looked the DB for the past x days. Then I loop for each date getting the summaries I need, and accumulate the values in an array for later display.
I have usually created a view with the date pieces broken out into columns, or you could put this into your SQL. For MS Access and MS SQL Server 7 the syntax is DatePart('yyyy',[Table].[DateTimeColumn]) /* year */ DatePart('m',[Table].[DateTimeColumn]) /* month */ DatePart('d',[Table].[DateTimeColumn]) /* day */ Or you could use: WHERE column > date AND column < (date+1day) -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Gene Wolf Sent: Wednesday, July 17, 2002 9:25 AM To: Multiple recipients of list witango-talk Subject: Witango-Talk: Not quite off topic timestamp to date OK, I need the advice from some of you guru's out there. This is probably simple but for some reason its escaping me. I have a database that contains prescriptions added by a doctors office. One of the fields in the record is a timestamp. Now, the office has asked me to create a report indicating the number of records added to the database per day. I can't use the timestamp field as it is because each one is unique. I've tried using the MSSQL convert function convert(char(11), DateAdded) but I get a result like Jul 15, 2002 and when sorted June comes out after July and April comes out first. Has anyone done this before and be willing to share the SQL code with me? I know it's gotta be simple yet I just can't see the solution. What I'd like is a date result and a count, like: 2002-06-15 48 2002-06-17 10 2002-07-01 46 etc. Thanks! Any help is greatly apprecaited. As Always, Gene Wolf ________________________________________________________________________ TO UNSUBSCRIBE: send a plain text/US ASCII email to [EMAIL PROTECTED] with unsubscribe witango-talk in the message body