Neal,


Book Recommendation :   Sams Teach Yourself SQL in 21 Days  :
http://www.amazon.com/exec/obidos/tg/detail/-/0672324512/qid=1073328907//ref
=sr_8_xs_ap_i3_xgl14/104-5044138-6895159?v=glance
<http://www.amazon.com/exec/obidos/tg/detail/-/0672324512/qid=1073328907//re
f=sr_8_xs_ap_i3_xgl14/104-5044138-6895159?v=glance&s=books&n=507846>
&s=books&n=507846
    Not perfect but a start.


SQL


something like


SELECT COUNT(orderID) AS TotalOrders
FROM ...
WHERE Month(EnteredDate)  = ?


? =  parameter


Now I am assuming this is Microsoft SQL.  If Oracle then you probably want
to use the TO_CHAR function to do comparison. I won't give you that answer
;)  . Just Google should get you for Oracle.


MSSQL's Query Analyzer is good for testing, in combination with BooksOnline
you can find a lot of good stuff.

Good Luck
Kevin

-----Original Message-----
From: Bailey, Neal [mailto:[EMAIL PROTECTED]
Sent: Monday, January 05, 2004 1:46 PM
To: CF-Talk
Subject: Count Orders by Month - Help

Hey guys,

I need a little direction...

I am trying to count orders placed for each month. I have an "EnteredDate"
field and all I am trying to do is display/count how many orders were placed
for each particular month. For some reason I cannot get this to work. I am
using SQL and MX 6.1.

Can someone show me a snippet of code to start with...

Once I get the values, I want to cfchart it. This I can do... but I always
have problem with dates and SQL.  

Also since it's obvious I suck at SQL, is there some type of program that
can help me write SQL statements. I usually can figure it out but my biggest
problem is remembering how to format everything (I waste so much on this).
It would be great if there was something like Dreamweaver where it has a
drop down list of options to choose from as you start to type. Well I guess
I will stick with my 1200 page Sams book.

Thanks,
Neal Bailey
Internet Marketing Manager
UGA-Association Field Services
E-mail:  <mailto:[EMAIL PROTECTED]> [EMAIL PROTECTED]
  _____
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to