Question
Query with a list
Hi everyone.
I've been stressing over how to do this, and it is trivial, it seems, but I'm just not quite sure.
I need to create a report (Mostly just tables. I got those out of the way first), but the confusing part of the report is selecting what goes where.
The report looks like a table, with each cell containing the number of events that falls within it's category (rows denote one field, columns denote another). My question is how to do the query.
The tricky thing is, on this web page there has to be 5 of these tables. The data are shown in the tabled dependent on certain date values they hold. For example, I need one table for things that will occur in 30 or less days, one for 30-90 days, and one for 90+ days.
I already did the logic to get the ID's of every piece of data for each table. I stored them in 3 lists, NearIDs, MidIDs, and FarIDs.
Basically, I want to do this for each cell:
SELECT Count(IDs) AS #field1##field2#IDs
FROM NearIDs
WHERE #field1# = #field1# AND #field2# = #field2#
I don't think that I can do that, though. Any suggestions?
EDIT: Okay, ignore everything above if you'd like. I'd still like to know how to do this technique, but the question I really need answered is as follows.
I have a few dynamically named integer variables that I need to change. For a simplistic example, this is what I have:
<cfset AAA = 0>
<cfset AAB = 0>
<cfset ABA = 0>
etc...
Now I want to do this:
<cfset #uservariable1##uservariable2##uservariable3# = #uservariable1##uservariable2##uservariable3# + 1>
Where uservar1, uservar2, and uservar3 are all either A, B, or C etc... (Basically I don't need to worry about undefined characters).
How do I write the code that might change AAA to 1 when uservar 1 = A, uservar2 = A, uservar3 = A or change AAB to 1 when uservar1 = A, uservar2 = A and uservar3 = B.
Thanks again,
-Bull
I've been stressing over how to do this, and it is trivial, it seems, but I'm just not quite sure.
I need to create a report (Mostly just tables. I got those out of the way first), but the confusing part of the report is selecting what goes where.
The report looks like a table, with each cell containing the number of events that falls within it's category (rows denote one field, columns denote another). My question is how to do the query.
The tricky thing is, on this web page there has to be 5 of these tables. The data are shown in the tabled dependent on certain date values they hold. For example, I need one table for things that will occur in 30 or less days, one for 30-90 days, and one for 90+ days.
I already did the logic to get the ID's of every piece of data for each table. I stored them in 3 lists, NearIDs, MidIDs, and FarIDs.
Basically, I want to do this for each cell:
SELECT Count(IDs) AS #field1##field2#IDs
FROM NearIDs
WHERE #field1# = #field1# AND #field2# = #field2#
I don't think that I can do that, though. Any suggestions?
EDIT: Okay, ignore everything above if you'd like. I'd still like to know how to do this technique, but the question I really need answered is as follows.
I have a few dynamically named integer variables that I need to change. For a simplistic example, this is what I have:
<cfset AAA = 0>
<cfset AAB = 0>
<cfset ABA = 0>
etc...
Now I want to do this:
<cfset #uservariable1##uservariable2##uservariable3# = #uservariable1##uservariable2##uservariable3# + 1>
Where uservar1, uservar2, and uservar3 are all either A, B, or C etc... (Basically I don't need to worry about undefined characters).
How do I write the code that might change AAA to 1 when uservar 1 = A, uservar2 = A, uservar3 = A or change AAB to 1 when uservar1 = A, uservar2 = A and uservar3 = B.
Thanks again,
-Bull
