ColdFusion Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreColdFusion Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
  #1  
Old June 10th, 2004, 09:32 AM
enuff_said21 enuff_said21 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 3 enuff_said21 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question Passing parameters in cfchart

Alright....I am developing chart that displays the year/month on the x-axis of a bar chart, and the y-axis is the total number incidents for all states from this data. When the user clicks on a certain bar, let's say 2004/3 (2004 March), I want to display a new bar chart that takes the data from March of 2004, and displays the individual state information for the selected month.

On my action page, I needed to display the year and month from a date/time field in my database. I did that by using DatePart. But in order to display them both in my chart, I needed to combine them, in order to do that I had to change them into strings.

How do I get my detail page to work so it displays all the state information for the selected month?

The query for my action page is below:

<cfquery name="LoginsByAllUsers" datasource="FCNNevin">
SELECT DatePart('yyyy', LoginDate) AS Year, DatePart('m', LoginDate) AS Month, Str$(DatePart('yyyy', LoginDate)) + Str$(DatePart('m', LoginDate)) AS YearMonth, Count(*) AS Logins
FROM LoginAttempt
WHERE Reason = 'ValidLogin'
GROUP BY DatePart('yyyy', LoginDate), DatePart('m', LoginDate), Str$(DatePart('yyyy', LoginDate)), Str$(DatePart('m', LoginDate))
ORDER BY DatePart('yyyy', LoginDate), DatePart('m', LoginDate)
</cfquery>

Reply With Quote
  #2  
Old June 10th, 2004, 10:06 AM
kiteless kiteless is offline
Moderator
Dev Shed Loyal (3000 - 3499 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,492 kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 3 Days 18 h 25 m 21 sec
Reputation Power: 44
I'm assuming that you are using database-specific functions where I see datePart(), etc, correct? And what is "str$"?

Does the query run when you run it from the RDBMS's command line or SQL editor?
__________________
Ask if you have a question, but also help answer questions that you have knowledge of! Thanks, Brian.
How to Post a Question in the Forums

Reply With Quote
  #3  
Old June 10th, 2004, 10:29 AM
enuff_said21 enuff_said21 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 3 enuff_said21 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I am using a Microsoft Access database, which does accept the DatePart() function. When you use DatePart to pull out the month and year like I have, it gives those numbers and integer type. So inorder to combine them using the "+", you need to convert them into string...which is what str$ does. I just took my two DatePart functions and wrapped them in str$ to convert them to string type.

The query does run in the SQL View in Access, it returns the Month, Year, YearMonth, and total Logins.

Reply With Quote
  #4  
Old June 10th, 2004, 06:14 PM
kiteless kiteless is offline
Moderator
Dev Shed Loyal (3000 - 3499 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,492 kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 3 Days 18 h 25 m 21 sec
Reputation Power: 44
hmm...if the query runs correctly then what exactly is the problem?

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreColdFusion Development > Passing parameters in cfchart


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five "checkpoints" for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway