Query of Queries and Dates

I am passing two dates from one page through to another page
in the URL like:
Football/results.cfm?min=2008-08-23&max=2009-01-24
On this page I am then running a query:
<cfquery name="result" datasource="Football">
SELECT Date as theDate, Home_Team, Home_Score, Away_Team,
Away_Score, Notes
FROM results
WHERE Date BETWEEN '#url.min#' AND '#url.max#'
ORDER BY Date, Home_Team;
</cfquery>
I then want to return only a subset of that query using
another query like:
<cfquery name="August" dbtype="query">
SELECT theDate, Home_Team, Home_Score, Away_Team, Away_Score,
Notes FROM result
WHERE theDate BETWEEN '2008-08-01' AND '2008-08-31'
ORDER BY theDate, Home_Team;
</cfquery>
<fieldset>
<legend class="month"><strong>August
</strong></legend>
<table summary="Stagecoach Ayrshire District League
Results - August 2008">
<tr>
<th scope="col">Date</th>
<th scope="col" class="team">Home Team</th>
<th scope="col"></th>
<th scope="col" class="team">Away Team</th>
<th scope="col"></th>
<th scope="col"></th>
</tr>
<cfoutput query="August">
<tr>
<td scope="row">#theDate# </td>
<td class="team">#Home_Team# </td>
<td>#Home_Score# </td>
<td class="team">#Away_Team# </td>
<td>#Away_Score# </td>
<td>#Notes#</td>
</tr>
</cfoutput>
</table>
<pre><a href="#Top" class="top">Return To
Top</a></pre>
</fieldset>
However I am not geting any output. Any help would be
appreciated.

cf is picky about datatypes in QoQs - try CASTing theDate in
your
'result' query as date...
Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com/

Similar Messages

  • Query on Vocie and Data VLan on same Swithc port

    Hi All,
    This is query regarding allowing both Vocie and data Vlans on a single switch port. I knew tehre are different ways to configure and acheive this, but not sure how techncially they are different from each other>
    Way 1:
    interface FastEthernet1/5
    description *** IP Phone/Data Port ***
    switchport trunk native vlan 10
    switchport mode trunk
    switchport voice vlan 16
    no logging event link-status
    no snmp trap link-status
    mls qos trust cos
    spanning-tree portfast
    sh int trunk
    Port      Mode         Encapsulation  Status        Native vlan
    Fa1/5     on           802.1q         trunking      10
    Fa1/7     on           802.1q         trunking      10
    Fa1/12    on           802.1q         trunking      10
    Fa1/13    on           802.1q         trunking      10
    Fa1/14    on           802.1q         trunking      10
    Port      Vlans allowed on trunk
    Fa1/5     1-1005
    Fa1/7     1-1005
    Fa1/12    1-1005
    Fa1/13    1-1005
    Fa1/14    1-1005
    Port      Vlans allowed and active in management domain
    Fa1/5     1,10,16
    Fa1/7     1,10,16
    Fa1/12    1,10,16
    Fa1/13    1,10,16
    Fa1/14    1,10,16
    Port      Vlans in spanning tree forwarding state and not pruned
    Port      Vlans in spanning tree forwarding state and not pruned
    Fa1/5     1,10,16
    Fa1/7     1,10,16
    Fa1/12    1,10,16
    Fa1/13    1,10,16
    Fa1/14    1,10,16
    sh vlan-switch
    VLAN Name                             Status    Ports
    1    default                          active    Fa1/0, Fa1/1, Fa1/2, Fa1/3
                                                    Fa1/4, Fa1/6, Fa1/8, Fa1/9
                                                    Fa1/10, Fa1/11, Fa1/15
    10  DVLAN                            active
    16  VVLAN                            active    Fa1/0, Fa1/1, Fa1/2, Fa1/3
                                                    Fa1/4, Fa1/6, Fa1/8, Fa1/9
                                                    Fa1/10, Fa1/11, Fa1/15
    In the above config, the port Fa 1/5 which is currnetly up and running( this port is ocnencted with IP phoen and a PC)  is not shown in sh vlan-switch output as assigned to vlan 10 or vlan 16. Not sure it is becuase the output was taken from ISR rotuer with NM 16-ESW module .
    sh int fa 1/5 switchp
    Name: Fa1/5
    Switchport: Enabled
    Administrative Mode: trunk
    Operational Mode: trunk
    Administrative Trunking Encapsulation: dot1q
    Operational Trunking Encapsulation: dot1q
    Negotiation of Trunking: Disabled
    Access Mode VLAN: 0 ((Inactive))
    Trunking Native Mode VLAN: 10 (DVLAN)
    Trunking VLANs Enabled: ALL
    Trunking VLANs Active: 1,10,16
    Priority for untagged frames: 0
    Override vlan tag priority: FALSE
    Voice VLAN: 16
    Appliance trust: none
    In above ocnfig, the port is configured as trunk and hence it can carry multiple vlan traffic on swithcport. As IP phones will have inbuilt switch which runs DTP by default and CDP to reciognize the conencted devcies.  I am not sure how this config works as even it's configured as trunk the DTP negotiation is disabled and how phone switch can differentiate the voice frames and data frames. Please explain in loigcal as it's known that as we have confgiured vlan 10 as native and vocie vlan 16 as trunk it carries the voice traffic.
    Way 2:
    interface FastEthernet1/2
    description *** IP Phone/Data Port ***
    switchport access vlan 10
    switchport mode access
    switchport voice vlan 16
    no logging event link-status
    no snmp trap link-status
    mls qos trust cos
    spanning-tree portfast
    In the above config, even the port is access it's carrying multiple vlan traffic despite of being trunk port. Not sure how the trunk will be formed even DTP neogotiation is off. Isi t because of voice vlan command and if so what it deos exactly.  Please can anyone elaborate in detail. Sorry, if my post is big and confusing
    sh int fa 1/2 switchport
    Name: Fa1/2
    Switchport: Enabled
    Administrative Mode: static access
    Operational Mode: static access
    Administrative Trunking Encapsulation: negotiate
    Operational Trunking Encapsulation: native
    Negotiation of Trunking: Off

    Switch - Phone - PC
    1. First question:
         # int f0/1
         # switchport mode access
         # spanning-tree portfast
         # switchport access vlan 50
         # switchport voice vlan 10
    This is the ideal way to configure and in all latest IOS Switches and in latest ISR routers, we do this as the command "switch port voice vlan" command  says to switch port that it carries the voice traffic as tagged and PC as untagged.
    As we all know the default switch port of a switch will be either Dynamic auto or Dynamic Desirable which means DTP is on and in turn it means negotiation of trunking is ON. This is as per my understanding.
    The Sub-Questions for 1st Question are below:
    1  Does the trunk negotiation happen between Access Switch switch port and Mini 3 Port Switch within the IP Phone. If mini switch in IP PHone negotiates to form  trunk based on DTP then what’s the default switch port mode of mini switch in the IP Phone.
    2. As in above config we are no where mentioning the port to be trunk. But it’s still allowing multiple vlan’s traffic to carry on access port. The switchport mode is access when you do “ sh int fa 0/1 swithcport.”.  Is it the swithcport voice vlan command does the magic?
    2. Second Question:
         # int f0/1
         # switchport trunk encapsulation dot1q
         # switchport trunk native vlan 10     (data VLAN)
         # switchport mode trunk
         # swichport voice vlan 15
    The Sub-Questions for 2nd Question are below:
    When do we use this configuration.? In my set-up the above config is seen on 2811 ISR routers with NM-16ESW modules.  Can’t we configure the data vlan a switch port access vlan 10 , instead of trunk native vlan.

  • Query of Queries With Date Strings

    Running cold fusion 9
    database query, from oracle, includes this in the select clause
    , to_Char(DateRequested, 'yyyy-mm-dd') thedate
    so it's a string.
    Then we have a url variable.  It's called thedate and the value is 2010-06-09.
    The objective is to get the record from the oracle query that matches the url variable.
    But this code:
    <cfquery name="ThisResource" dbtype="query">
    select FundingResourceId, status, thedate
    from PatientResources
    where thedate = <cfqueryparam cfsqltype="cf_sql_char" value="#url.thedate#">
    </cfquery>
    will not return any rows.  This includes many attempts that included hard coding the value, checking for white space, etc.  Nothing I tried returned the row.  However, when I changed this:
    where thedate = <cfqueryparam cfsqltype="cf_sql_char" value="#url.thedate#">
    to this
    where thedate LIKE <cfqueryparam cfsqltype="cf_sql_char" value="#url.thedate#">
    it returned the expected record.  Note that I didn't even need a wildcard.
    Anybody have any thoughts on this?

    This looks like a bug to me.  I tried your example and got the same results in CF8 and CF9, though it works as expected in Railo...
    It seems like it's trying to guess that you really wanted that to be a date.  Change your example from
    q = QueryNew("s","varchar");
    to
    q = QueryNew("s");
    And you'll see:
    q - query
    S
    1
    {ts '2010-06-10 00:00:00'}
    z - query
    S
    1
    {ts '2010-06-10 00:00:00'}

  • Numbers - Query about charts and dates

    I have a simply spreadsheet with 2 columns showing dates and electricity readings.
    Ive added a chart so I can see the electricity usage over time, but its showing each date eqidistant rather than showing them on a timeline.
    Can anyone tell me what Im doing wrong?

    Looks like Numbers cannot plot date data. Please provide Numbers Feedback to Apple.
    Regards,

  • Is Query of Queries faster than multiple WHERE criteria?

    If I need a recordset based on two table column fields (let's say firstName and lastName), is it better to run one query with a WHERE firstName = x AND lastName = y, or is it better to query of queries and find all records with a specified firstName, and then query that query to filter only records with a specified last name?  Which is the better/faster method?
    <cfquery name="somequery" datasource="someds">
    SELECT *
    FROM sometable
    WHERE firstName = 'John' AND lastName = 'Smith'
    </cfquery>
    or....
    <cfquery name="somequery" datasource="someds">
    SELECT *
    FROM sometable
    WHERE firstName = 'John'
    </cfquery>
    <cfquery name="somequery2" dbtype="query">
    SELECT *
    FROM somequery
    WHERE lastName = 'Smith'
    </cfquery>

    As a rule of thumb, make the database server do all the work... i.e. locally.  If what you are interested is "first name = x and last name = y," then those are the only records that you want to be "sent over the little wire" to you.  "The little wire" is always the bottleneck.

  • Capturing system time and date and the time difference and date difference.

    Hello Experts,
    i have a requirement the i need to capture select query start time and date as i runthe program on midnight (ie) 11:55 p.m.
    I tried system fields sy-datum and sy-uzeit for capturing the system date and time when my program runs but it gets reset when the date changes.
    i tried get time field option but it is resetting the sy-datum to zero so i am able to capture the date of the next day and resulting in wrong calculation of time .
    please help with your valuable answers.
    Thank you,
    Srinivas.

    Hi,
    As per my understanding you want to fetch those data which are created between the program last run date time and current date time.
    If I am right please follow the below procedure.
    1. Create one custom table to store program name and program execution last date time
    2. at event INITIALIZATION populate to fields date and Time using the statement sy-datum
    initialization.
      v_curr_time = sy-uzeit.           " Current time
      v_curr_date = sy-datum.           " Current date
    3. Get the last run date and time from the above custom table.
    4. Do your logic.
    5. at last Update the custom table with current date and time based on the step two (Here do not take sy-datum like that, take the value in the global variable populated in step 2)
    Thanks
    Subhankar

  • Can we suppress execution of a query so as to optionally execute queries in data modl

    Can we suppress execution of a query so that we optionally execute queries?0
    I have a combo box in Parameter Form. It has 3 options. I have 3 queries in Data Model.
    I want to execute only one of these 3 queries based on user's selection from combo box.
    I want that other 2 queries do NOT execute at all for that processing cycle. Next time user selects other option and an other query is executed and other 2 are NOT executed and so on.
    Is it possible in Reports 6i in Client/server?
    Pl. guide.
    Tariq

    Include:
    AND :parameter = <this query's value> (e.g. 1 or "SALES" or whatever)
    in each query's where clause. Because this is 2 constants (as far as the SQL interpreter is concerned) it will evaluate it first. If the parameter is set to a value not for this query then it will return no rows with minimal overhead.

  • Query of queries date comparison

    Cut to the basics, I'm trying to run the following code:
    <cfset qData = QueryNew("dataDate,ID")>
    <cfset padDate = "#DateFormat(Now(),"dd mmm yy")#
    23:59">
    <cfset queryAddRow(qData)>
    <cfset QuerySetCell(qData,"ID",1)>
    <cfset QuerySetCell(qData,"dataDate",padDate)>
    <cfset delDate = "#DateFormat(Now(),"dd mmm yy")#
    00:00">
    <cfquery name="qZero" dbtype="query">
    SELECT ID
    FROM qData
    WHERE dataDate = '#delDate#'
    </cfquery>
    This works fine in MX7 but I need to put it on a server using
    MX6.1. It appears that in 6.1 query of queries considers the
    dataDate field to be a date but will not accept a date on the right
    hand side of the equals sign in the where clause so comes up with
    'Unsupported type comparison'. Is there any way round this?

    I just ran into this problem actually.
    What appears to be happening is QoQ has trouble comparing SQL
    date types and DB date types. I had to perform an lsdateformat on
    the data to get it to process.
    I am also looking into a problem where QoQ is switching my
    dates to strings. CF has yet to impress me. For every kind of cool
    thing they do there are 25 lame things.

  • Vbscript / asp and DATEs in recordset query

    I've been using dreamweaver for about 5 years now, and its all be mostly vbscript - classic asp based stuff....   mostly small scale stuff using MS Access db as backend datasource.
    i've always had issues with using the recordset building dialogue window/box under server behaviors in terms of building a query using the 'advanced' tab/option and having a date field from my database (formatted like mm/dd/yyyy) used  in the filtering of records... the text based  queries are all a cinch and very easy to do, but for dates I always run into issues.
    right now im simply trying to make sure all the returned records are AFTER the 'current date'  - date() ...
    and dw cs5 has this line added for the default value: RS_Events_cmd.Parameters.Append RS_Events_cmd.CreateParameter("param3", 135, 1, 1, RS_Events__MMColParam3) ' adDBTimeStamp
    in my query im asking And EventDate > ?     ---- basically, where the date of the record in the database is GREATER than or AFTER the current date or a user-defined variable for the date... the default is the current date though.
    something tells me the problem is probably related to the 135,1,1 area  of that string, but i dont know what to try... i've tried changing the last 1 to -1 and 0  but still same error "Application uses a value of the wrong type for the current operation." and it cites that same line of code i just mentioned.
    i might add the database has the date field formatted correctly and im able to use hand-written code to query it just fine, but i know there has to be a way for dw to handle it so my code isnt 'tacked' on and making a mess of the dw routines.
    anyone familiar with any of these issues as relates specifically to vbscript / asp and the use of date() in dw recordset queries?

    Hi,
    <i>I need to use a date to calculate a key figure.</i>
    Here you will use the formula variable with replacement path.
    <i> Can I filter these null values at the query level.</i>
    Yes, it is possible in query level.
    For example, in the formula :
    (0calday = '')* (do what ever you wan to do in case date is null) + (NOT (0calday = ''))* (do what ever you wan to do in case date is not null)
    With rgds,
    Anil Kumar Sharma .P

  • Need MDX query to find something like date diff and Date Range for last 10 days

    Hi ,
    I need two Query .First Query for below;
    I have below data in table like.
    Cat      StartDate    EndDate     
    A    2000-01-01     2000-01-15   
    B    2000-01-02     2000-01-30    
    C    2000-01-01     2000-01-31    
    D    2000-02-01     2000-02-28    
    A    2000-01-10     2000-01-31    
    I need if Startdate and Date completes whole one month then set status =1 else  0 using MDX query.
    like this ;
    Cat      StartDate    EndDate       Status
    A    2000-01-01     2000-01-15    1
    B    2000-01-02     2000-01-30    0
    C    2000-01-01     2000-01-31    1
    D    2000-02-01     2000-02-28    1
    A    2000-01-10     2000-01-31    1
    In second query I need last 10 days from current days like;
    Now = 8/20/2014
    output will be ;
    8/20/2014
    8/19/2014
    8/18/2014
    8/17/2014
    8/16/2014
    8/15/2014
    8/14/2014
    8/13/2014
    8/12/2014
    8/11/2014
    8/10/2014
    Please help me .
    Thanks

    Hi Prajapati,
    In your scenario, you can use Properties and Datediff function to achieve your requirement. Since not know the structure of your cube, we cannot give you the esact query.
     I have tested it on the AdventureWorks cube, the query below is for you reference.
    WITH MEMBER [Measures].[StartDate]
    AS
    [Employee].[Employee Department].CURRENTMEMBER.PROPERTIES('Start Date')
    MEMBER [Measures].[WorkYear]
    AS
    DATEDIFF('yyyy',[Measures].[StartDate],NOW())
    MEMBER [Measures].[Status]
    AS
    IIF(DATEDIFF('yyyy',[Measures].[StartDate],NOW())>10,1,0)
    SELECT {[Measures].[StartDate],[Measures].[WorkYear],[Measures].[Status]} ON 0,
    [Employee].[Employee Department].[Employee].MEMBERS ON 1
    FROM [Adventure Works]
    Results
    Reference
    http://msdn.microsoft.com/en-us/library/ms144821.aspx
    Regards,
    Charlie Liao
    TechNet Community Support

  • Custom Report Query - Patches install on specific computer AND date installed

    I'm looking to create a 2 custom reports that show installed.  I have a similar report already but it shows patches needing to be installed.
    Devices in a collection with columns for total number security patches installed (I'll break them out further by severity) 
    Breakdown of each patch installed on a computer (from report 1) and the date installed. (may also include severity, KB article, description etc.  I already have these fields)
    Essentially I'm looking for the query to pull this data and add to an existing report format I'm already using.
    Ideas?

    Garth,  
    Thanks for the reply.  I've flipped the 2->3 in the report and that gave me what I needed.  
    The other piece was the date installed. This was not in either report.  I did however find it under the database view ucsa.LastStatusChangeTime which my report was already pulling.

  • SAPbouiCOM.DBDataSource.Query and Date fields

    When I try to add a Condition that uses an Alias for a database field of type datetime, the Query method crashes.
    Is there a specific Date format that I am supposed to use?
    I am currently using the SAP date format and I also tried the database date format. Both crashed the Query method.

    My customer's date format is mm/dd/yy and that is the format I was using. Here is what my code looks like for debugging this problem which is still crashing on the Query method:
    conditions = new SAPbouiCOM.Conditions();
    condition = conditions.Add();
    condition.Alias = "U_PLS_PkgD";     
    condition.Operation = SAPbouiCOM.BoConditionOperation.co_GRATER_EQUAL;
    condition.CondVal = "03/11/2004";
    dbDataSource.Query(conditions);
    I have also tried the following date formats:
    condition.CondVal = "11/03/2004";
    condition.CondVal = "03-11-2004";
    condition.CondVal = "2004-11-01";
    "U_PLS_PkgD" is a field in my user table that is of type datetime in the database. I can Query with varchar and int database fields. Just not datetime fields.
    Please advise. Thank-you.

  • Duplicate Queries and Query Components in BI Production Box

    Hi:
    We have a situation where we have duplicate queries and query components in our Production BI box.
    The problem was caused by transports.  We have a development landscape and a support landscape where both are transporting separately up to the BI Production Box. 
    For example, query ABC was created in the development landscape and transported up to our production box.
    The same query ABC was created in our support landscape and transported up to our production box.
    Now in the production box we have 2 queries ABC with the same technical name and description but with different active ELTUIDs.  
    We have found the program ANALYZE_RSZ_TABLES and it does show us this problem in our production box with many queries and query components.
    The question is how do we get rid of the duplicate ELTUIDs in our Production box and how do we stop this from happening during transport?
    any suggestions would be helpful.

    Hi JC,
    I think you can use Tcode RSZDELETE to delete the duplicate UIDs of elements or any query objects.
    Test it in dev box / sandbox before using it in prod.
    Thanks

  • How to query in SCCM 2012 to know how many active and inactive clients in a specific time and date

    Dear Everyone,
    Good morning. I need to perform a query to know how many clients PCs are active or inactive during the a specific time and date (let say, today 9pm). In my query, I want to know:
    1. How many client PCs is active at that time and date?
    2. How many client PCs is not inactive at that time and date?
    Any assistance is greatly appreciated. Thanks.

    Thank you Gerry for pointing out that it doesn't show real time date. I do agree with that. However, I am look at the (at least in this) report which supposed to [description] shows a list of computers not reporting any power activity for a specified date
    and time. Since I can only key in date in my selection (time option not given), I am expecting the report to show me whether there any client PCs that doesn't any power activity for the specified date. A list was generated, and a number of them shows HardwareInventoryScan,
    LastHeartBeatScan and LastPolicyRequest on the same date itself. I would like to know why these appears, so that I can learn from it.
    Due to the selection option given, I can't expect my original goal, but at least (hopefully) I can get to know (past event) how many and which client PCs is not powered on a particular date based on the date and collection selected.
    At least by getting explainations, I hope to learn something from this (how to read this report). Thanks in advance.

  • Standard Query for Top 10 queries and Users

    Hi Experts,
    Is there any query which gives the details like ,
    1. Top 10 queries executed in a month
    2. Top 10 users ( By no of queries executed )
    Regards,
    Bhadri M.

    1. Top 10 queries executed in a month
    Use Query 0TCT_MCA1_Q0142.
    In this report you will have to filter variable BI Object to Queries and also it gives stats for the last 30 days, you have have to remove the SAP User exit variable in case you do not want to use the 30 days option. And then you will have to define Condition for Top 10.
    2. Top 10 users ( By no of queries executed )
    Use Query 0TCT_MCA1_Q0141.
    Similarly you have to modify this query.
    -Neelesh

Maybe you are looking for

  • Bypassing the logon page

    <p>Hi,</p><p>I have been using the openDocument  function as detailed in the topic <a href="/node/1780">Opening a report in a new window on the web</a> to display a crystal report. Unless I happened to have already logged into InfoView I am first tak

  • Private Constructs in Packages

    Can't I refer a private function in a SQL statement which is inside a Public Procedure. Both Private Function and Public Procedure are in the same Package. I just recreated the scenario using a simple procedure and a function inside a Package. Please

  • Hierarchy Reporting - Suppress levels

    Hi I am using a Hiearchy to provide Grouping and Order. However, for certain Queries, I need to report at the lowest level, in Hierarchy Order, but WITHOUT displaying the levels above the lowest level. Any tips on how to do this, preferably within th

  • Working around incompatible pointer via NSImage and NSStatusBar

    I'm giving a status bar item an image through NSImage. I'm running into were the app builds and opens in the status bar, but the image I want dosen't display. I receive a warning saying "Incompatible pointer types sending 'NSString' to parameter of t

  • Re: Financial statement versions

    Dear Experts, In FSE2 i created few more Create Items few under object name and saved but when i am saving the after Creating Items the system is telling a message of... Financial statement version ABC saved; see long text Message no. FE713 Procedure