Hmm,

Try something like this:

declare @thisDate datetime
set @thisDate = '02/04/2005 01:23:03'

SELECT convert(datetime,
convert(varchar(4),Month(@thisDate))+'/'+convert(varchar(4),day(@thisDate))+
'/'+convert(varchar(4),year(@thisDate))) AS oneDay, count(OrderID)

FROM Table
GROUP by oneDay
ORDER BY oneDay

> -----Original Message-----
> From: Raymond Camden [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, March 02, 2005 10:28 AM
> To: CF-Community
> Subject: Re: dumb sql question
> 
> Sorry, I forgot to say - this is MS Access (yes yes, I know, but it is
> for a friend who has a super simple site and doesn't need to shell out
> for SQL Server).
> 
> 
> On Tue, 1 Mar 2005 20:31:03 -0600, Dawson, Michael <[EMAIL PROTECTED]>
> wrote:
> > You need to use some functions to get what you want.  Assuming this is
> > SQL Server 2000...(Should be similar for other implementations.)
> >
> > SELECT
> >     CONVERT(varchar(10), dateColumn, 105) AS dateColumn
> >     ,COUNT(CONVERT(varchar(10), dateColumn, 105)) AS dateCount
> > FROM
> >     TableName
> > WHERE
> >     dateColumn IS NOT NULL
> > GROUP BY
> >     CONVERT(varchar(10), dateColumn, 105)
> > ORDER BY
> >     dateColumn
> >
> > M!ke
> >
> > -----Original Message-----
> > From: Raymond Camden [mailto:[EMAIL PROTECTED]
> > Sent: Tuesday, March 01, 2005 8:12 PM
> > To: CF-Community
> > Subject: dumb sql question
> >
> > I want to count the number of orders per day, where the datetime
> > property has, obviously, a date and time. I want to ignore the time and
> > just get a sum based on date. I know this is simple, but it's been a
> > real long day.
> >
> > --
> > =======================================================================
> > Raymond Camden, Director of Development for Mindseye, Inc
> > (www.mindseye.com)
> >
> > Member of Team Macromedia (http://www.macromedia.com/go/teammacromedia)
> >
> > Email    : [EMAIL PROTECTED]
> > Blog     : ray.camdenfamily.com
> > Yahoo IM : cfjedimaster
> >
> > "My ally is the Force, and a powerful ally it is." - Yoda
> >
> >
> 
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Find out how CFTicket can increase your company's customer support 
efficiency by 100%
http://www.houseoffusion.com/banners/view.cfm?bannerid=49

Message: http://www.houseoffusion.com/lists.cfm/link=i:5:148866
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/5
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:5
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.5
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to