Ask a Question related to Coldfusion Database Access, Design and Development.

  1. #1

    Default QoQ date filter

    I thought this would be straightforward but apparently not. I have a query
    that selects a date field from an Oracle table. I then want a query of queries
    to return those rows where the date is between two values represented by form
    parameters.

    I have searched in vain for the answer to this. I thought
    ...where date_field between #CreateODBCDate(begindate)# and
    #CreateODBCDate(enddate)#
    should work but that causes a Query Of Queries syntax error (the SQL shown
    with the error confirms the ODBC date is created correctly).

    Some references suggest I should use CFQUERYPARAM but I haven't had any luck
    with my attempts to do so.

    Any suggestions?

    Ken

    gr8white Guest

  2. Similar Questions and Discussions

    1. JSObject returns wrong date. How can Iextract correct date from digital signature?
      I'm trying to extract name and date from digital signatures by using JSObject in Excel VBA, but JSObject returns wrong date. Year, month, hour and...
    2. #40499 [NEW]: filter sapi does not register any highlightning filter
      From: php at henke37 dot cjb dot net Operating system: any PHP version: 6CVS-2007-02-15 (CVS) PHP Bug Type: Apache2 related...
    3. Data Grid Header Filter Renderer or how do I get aheader to filter the data in a datagrid.
      Okay so on the same theme as why isn't the datagrid like Excel, I have created a (very cool) Filter header. 1) The filter looks like any other...
    4. Filter records by date and time
      any chance to help me on this pls .. can anyone tell me how i can sort my table by date and time i wanna put down specific DATE and TIME into my db...
    5. testing for a null Date in the Filter property of a RecordSet object?
      Hello, I am new to using the filter property. When I try publishDate = '' I get a type mismatch error. Any ideas? Thanks Rich
  3. #2

    Default Re: QoQ date filter

    I havent tried this in a Q-of-Q, but you might try using the ParseDateTime()
    function to create your date/time object, rather than CreateODBCDate. Something
    like this?

    ....where date_field between #ParseDateTime(begindate)# and
    #ParseDateTime(enddate)#

    Phil




    paross1 Guest

  4. #3

    Default Re: QoQ date filter

    Phil, thanks for the suggestion.

    I did finally get this to work using CFQUERYPARAM (and also correcting a
    syntax error that was getting in the way). For the benefit of anyone else who
    might run into this issue, the solution is below.
    Ken


    where scan_date between <cfqueryparam cfsqltype="cf_sql_date"
    value="#begindate#">
    and <cfqueryparam cfsqltype="cf_sql_date" value="#enddate#">

    gr8white Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139