John,

Are your elevation value stored in feet units?

If so, you can set a new variable:

<cfset chart_me_calc="integer(elevation/500)">
   (the actual syntax may be different for your db.)

Then:
<cfset chart_me="elevation">
<cfparam name="chart_me_code" default="#chart_me#">

select #chart_me_calc# as #chart_me#, count(*) as Chart_count

Post the url when you are done so we can check it out.

Jerry Johnson

>>> [EMAIL PROTECTED] 11/14/03 11:04AM >>>
I have a website describing hikes I have taken.  I have recently added a
charting page to chart much of the data I collect such as Region,
Recommendation, Difficulty which works fine (since these values are
essentially categorical ones with few values 5-6).  However I also am
trying to chart Time, Elevation gain, and Distance hiked.  Elevation
Gain in particular charts poorly as hardly any of the 60 hikes had the
same gain.

What I would like to do is when I am charting Time, Elevation gain, and
Distance I would like to categorized the output into just a few.  For
Elevation it would probably be best to use 500ft increments.  0-500,
500-1000, 1000-1500 and so on.

The current query I am using for the cfchart call is:

SELECT #ChartMe#, count(*) as

Chart_count

FROM hike

Where #ChartMe# is not null

group by #ChartMe#

order by #ChartMe#;

Does anyone have an idea of how this query might be amended or otherwise
rewritten to allow the above categorization to happen rather than just
counting discreet instances?  I have tried searching the web for quite a
while to no avail, and was thinking this group might have some clues.
Even good sql sites, groups, or book recommendations would be very
welcomed.

Thanks sincerely,

John






[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to