Query a date field in report builder

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

  1. #1

    Default Query a date field in report builder

    I can't write a report that queries a access database using a where clause that
    uses a variable as the input where the column datatype is 'Date'. I can't seem
    to do it. Any Geniuses out there who are smarter than me please help!!!! I
    have tried without success to query a access database using a date field as a
    constraint & a variable. example 1 select unitname, sum(revenue) as
    revenuetotal, sum(runlength) as runtime where (wr.id='#id#' and rundate <
    #startdate#) group by unitname example 2 select unitname, sum(revenue) as
    revenuetotal, sum(runlength) as runtime where (wr.id='#id#' and rundate <
    #2/1/2005#) group by unitname example 1&amp; 2 will both work in the test
    mode, but only example 1 will work in an actuall CFMX7 report. the date field,
    can't be passed for some reason as a parameter. the # signs are required, and
    even if I embed the # signs in the parameter and pass them, it won't work,
    other than when I test the query. I can pass parameters to every field except
    a date field. I can query the date filed using cfml without a problem, it is
    just in the report that is driving me nuts!! I am hoping that I am just
    overlooking something. Those of you who use the report tool will run into this
    sooner or later, help me solve this one now. Thanks, Jeremy Merritt

    Boise-J-Man Guest

  2. Similar Questions and Discussions

    1. SQL Query in Report Builder
      otherway, use the storedprocedure in advanced query builder, pass all parameters, and control in stored procedure
    2. Report Builder (expression builder syntax)
      I'm trying to create a calculated field that will compare the values from one query field and depending on the values will assign a value to the...
    3. CF Report Builder query editor crashes
      :disgust; I am trying to display a symbol in a column of my report. In the query editor I added an extended ascii character. Now when I try and...
    4. CF Report Builder
      I am trying to generate a pricelist report using the new CF 7 Report Builder. When I add an image to the reprt and try to dynamically build the...
    5. Problem with ADO query against a DBF date field
      Marit, Jet and VBScript use the same underlying numeric representations of date/time values, and your best bet is to pass your value as a numeric...
  3. #2

    Default Re: Query a date field in report builder

    Problem solved ! the query had to be removed from the report and worked when
    placed only in the .cfm file as follows. SELECT UnitName, sum(Revenue) as
    rev, sum(RunTimeTotal) as rtt FROM AllActivity where ((id='#ID#') and
    ((datestamp > ###startdate###) and (datestamp < ###enddate###))) group by
    unitname ORDER BY UnitName note the ###

    Boise-J-Man 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