• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

output data from different dates?

New Here ,
Apr 13, 2014 Apr 13, 2014

Copy link to clipboard

Copied

I have thsi code.

<cfquery datasource ="Intranet" name="GetDeptSubmissions">SELECT * FROM CSEReduxResponses</cfquery>

<cfquery dbtype="query" name="GetPending">SELECT * FROM GetDeptSubmissions WHERE status = 1 AND execoffice_status = 0</cfquery>

<cfquery dbtype="query" name="GetApproved">SELECT * FROM GetDeptSubmissions WHERE status = 1 AND execoffice_status = 1</cfquery>

<cfquery dbtype="query" name="GetDenied">SELECT * FROM GetDeptSubmissions WHERE status = 1 AND execoffice_status = 2</cfquery>

<cfoutput>

          <h2>Comments / Ratings Administration</h2>

          <div>

                    <div class="display_count pending_outer">

                              <div class="display_count_desc pending_inner">Pending</div>

                              <cfif GetPending.RecordCount gt 0><a href="cse_execoffice_pending.cfm"></cfif>

                                        <span class="display_count_number">#GetPending.RecordCount#</span>

                              <cfif GetPending.RecordCount gt 0></a></cfif>

                    </div><!--- /div class="display_count" --->

                    <div class="display_count approved_outer">

                              <div class="display_count_desc approved_inner">Approved *</div>

                              <cfif GetApproved.RecordCount gt 0><a href="cse_execoffice.cfm?approved"></cfif>

                                        <span class="display_count_number">#GetApproved.RecordCount#</span><br>

                              <cfif GetApproved.RecordCount gt 0></a></cfif>

                    </div><!--- /div class="display_count" --->

                    <div class="display_count denied_outer">

                              <div class="display_count_desc denied_inner">Denied</div>

                              <cfif GetDenied.RecordCount gt 0><a href="cse_execoffice.cfm?denied"></cfif>

                                        <span class="display_count_number">#GetDenied.RecordCount#</span><br>

                              <cfif GetDenied.RecordCount gt 0></a></cfif>

                    </div><!--- /div class="display_count" --->

          </div>

</cfoutput>

and it works good. in this link is how it looks like http://i.stack.imgur.com/jEV1K.png 

This gets all the data from table CSEReduxResponses, I want to create a new one for each month that the data comes in. for example

in table csereduxpesonses there is a column APPROVEDDATE (datetime) ,from this collumn i want to ouput the <div class="display_count pending_outer">for every month. so there will be one for APRIL , MAY , ect.

any suggestion on how to do this or examples would help , thanks

Views

422

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 13, 2014 Apr 13, 2014

Copy link to clipboard

Copied

I wouldn't know where to start. You know the code better than anyone. So, do the code, and let us make suggestions. That would be far more profitable to you.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 13, 2014 Apr 13, 2014

Copy link to clipboard

Copied

thats the thing i dont know where to start either. i have trying to google something similar that can give me a idea. I would think it would be a a if statement maybe

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 13, 2014 Apr 13, 2014

Copy link to clipboard

Copied

LATEST

no_name_123 wrote:

thats the thing i dont know where to start either. i have trying to google something similar that can give me a idea. I would think it would be a a if statement maybe

I don't think you need to google anything. You already have a lot of information, and knowledge, about what you want. Here it is:

and it [given code] works good. in this link is how it looks like http://i.stack.imgur.com/jEV1K.png 

This gets all the data from table CSEReduxResponses, I want to create a new one for each month that the data comes in. for example

in table csereduxpesonses there is a column APPROVEDDATE (datetime) ,from this collumn i want to ouput the <div class="display_count pending_outer">for every month. so there will be one for APRIL , MAY , ect.

You have knowledge of these requirements, we don't. The challenge is for you to convert the information into code or even pseudocode. That would make it easier for the rest of us to join in.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Apr 13, 2014 Apr 13, 2014

Copy link to clipboard

Copied

Dont use "Select * from table".  Only return the columns you need.  Not doing so can have a major performance impact on your queries and system as a whole.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation