Data Manipulation Techniques

Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.

  1. #1

    Default Data Manipulation Techniques

    Hi, I am working on an Application that pulls data from a variety of tables.
    I would like to run monthly reports and all of the queries will change from
    month to month based on whatever Month the user selects. Things are involved
    like Calendar running year information and fiscal year information so every
    month will be different for example: an FY report for December 2004 (which is
    avail Jan 1 2005) will include a date range from Oct 1 - Dec 31 2004 and a
    calendar year report for August 2004 (which is avail Sep 1 2004) will include
    a date range from Jan 1 - Aug 31 2004. What I havent been able to find are
    techniques or examples used to help me construct these queries so that they are
    dynamic and wont have to be changed every month by hand. They will simply
    changed based on whatever the user selects from lets say a drop-down menu or
    inputting a month/year to run the report they want. I have queries that work,
    but we have to change them every month for the different dates by hand. Does
    anyone have any information to get me started on the right track?? If not any
    other websites that explain how to do this would be greatly appreciated. I
    always love a good tutorial. Thanks!!

    MeltdownMX Guest

  2. Similar Questions and Discussions

    1. Old ASP - data manipulation
      Hi all, My application is based on old ASP (not .NET). I have a page which should display several DB records and allow inserting/updating/deleting....
    2. Favorite Tips/Techniques
      I know there are various sites that list tips and tricks, but it might be nice to list some of our favorites here in the forum. My contribution: ...
    3. data manipulation
      I am working on WinXP and using FileMaker 6.04 I have a fairly large amount of data in a text file, Massachusetts Insurance Agents, that looks...
    4. blurring techniques
      I have an image which consists of a rocky foreground, a tree, and a blue sky. I printed the image at 8x10, and it came out quite well. When I printed...
    5. techniques used
      hey, i am in the middle of building a website, and am trying to dig a bit deeper into photoshop for my image editing. check out this link :...
  3. #2

    Default Re: Data Manipulation Techniques

    You can include ColdFusion code in your SQL between the <cfquery> tags. For
    example, if you wanted to select by the value of a variable Request.ID, the
    code might look like this: <cfquery name='qTest' datasource='XXX'> SELECT *
    FROM PERSON WHERE ID = '#Request.ID#' </cfquery> The WHERE clause can
    even be built up from a series of <CFIF> tags, so that the select can be highly
    variable based on user-inputted values.

    mike.short Guest

  4. #3

    Default Re: Data Manipulation Techniques

    Hi Mike, thanks. I know how to do all that already. Maybe I am making it more
    complicated than it is. There are several date functions in SQL and in CF. I
    didnt know if anyone knows some good techniques in using them to generate
    reports or websites / tutorials that focuses on that kind of stuff. I would
    like to use the power of SQL to do all the fetching for me instead of
    incorporating tons of if statements and things like that.

    MeltdownMX Guest

  5. #4

    Default Re: Data Manipulation Techniques

    ColdFusion does have a full range of date functions that you can use in this
    situation. You need to develop an algorithm that takes the user's choices and
    translates that into an appropriate SQL statement. Based on your example, it
    looks like a FY report runs from Oct 1 through the end of the month selected,
    and it will be available the following month. So your form that lets the user
    make selections can be programmed to get the current date and then display the
    previous month back to the earliest report as options. The program that
    processes this can take that month and year and create a date object that is
    the last day of the month at 11:59 pm. You then use this information in a SQL
    statement to select dates BETWEEN your start date (Oct 1) and this end date.
    You'd use the same technique for an annual report. If this is what you are
    trying to do and you need more explanation, please let me know. Paul Dempsey
    Dickinson College

    dempster 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