I'm running a report from 01/2005 - 01/2006 but I'm only getting back
everything for the month of January(01/2005) any ideas why this would happen
but if I do 01/2005 - 12/2005 I get back all the months. So for some reason it
won't read into the next year (2006). So if anyone can help me out with this I
would really appreciate it.
<cfif (URL.st_date) NEQ "" AND (URL.en_date) NEQ "">
<cfquery name="paid" datasource="FRG">
select * from
(Select Count(Distinct Claim_number) AS ClaimNum_Count,
Group_Date,SUM(Cont_Amt) AS Amount,SUM(AA_Amt)As Ad_Amount,SUM(NR_Adj) AS
nradj_amount,SUM(NR_NAdj) AS nrnadj_amount,SUM(CA_NAdj) AS
canadj_amount,SUM(Pending) AS pend_amount,SUM(Disagree) AS
disagree_amount,SUM(D_Recoverable) AS disRec_amount,SUM(Net) AS Net_Amount
FROM dailyClaims
WHERE IPA_ID = '#URL.ipa_code#' AND IPA_Action <> 'None' AND Group_Date
BETWEEN '#URL.st_date#' AND '#URL.en_date#'
GROUP BY Group_Date) a,
(select Count(Distinct Claim_number) AS ClaimCount,Count(Distinct
Claim_Number) As Cont_Count,SUM(Net) AS
Net,SUM(Billed) AS BILLED, SUM(Allowed) AS Allowed, SUM(Copay_Amt) AS
Copay_Amt, SUM(Cont_Amt) AS
Cont_Amt,SUM(AA_Amt) AS AA_Amt,SUM(NR_Adj) AS NR_Adj,SUM(NR_NAdj) AS
NR_NAdj,SUM(CA_NAdj) AS CA_NAdj,SUM(Pending) AS
Pending,SUM(Disagree) AS Disagree,SUM(D_Recoverable) AS D_Recoverable,
Group_Date 'b_Group_Date'
from dailyClaims
WHERE IPA_ID = '#URL.ipa_code#' AND IPA_Action <> 'None' AND Group_Date
BETWEEN '#URL.st_date#' AND '#URL.en_date#'
AND Cont_Amt <> 0
GROUP BY Group_Date) b
where Group_Date = b_Group_Date
</cfquery>
<cfelse>
<cflocation url="reports_main.cfm?msg=Please make sure you select a report,
IPA and enter a start date and end date!" addtoken="no">
</cfif>
<CFSET oldmonth = 99>
<cfoutput query="paid">
<CFIF Month(Group_Date) NEQ oldmonth>
<CFSET oldmonth = Month(Group_Date)>
<cfset total_ClaimCount = total_ClaimCount + #ClaimNum_Count#>
<cfset potn_saving = potn_saving + #Cont_Amt#>
<cfset adj_amount = adj_amount + #Amount#>
<cfset nradj_amount = nradj_amount + #NR_Adj# - #Ad_Amount#>
<cfset nrnadj_amount = nrnadj_amount + #NR_NAdj#>
<cfset canadj_amount = nradj_amount + #CA_NAdj#>
<cfset pend_amount = pend_amount + #Pending#>
<cfset disagree_amount = disagree_amount + #Disagree#>
<cfset disRec_amount = disRec_amount + #D_Recoverable#>
<cfset Net_total = Net_total + #Net_Amount#>
----HTML SYNTAX-------
</cfif>
</cfoutput>
Dan Bracuk - 29 Sep 2005 21:09 GMT
This line looks problematic
where Group_Date = b_Group_Date
The way you describe the problem, I would expect to see something like
where group_date between date1 and date2
reya276 - 29 Sep 2005 21:16 GMT
believe me the query is complex, the reason I did this is so that I can get
sums, counts all by distinct claim numbers between date1 and date2. IF you
have a better way of getting this data then by all means modify the query. I
would appreciate the help because I don't know what else to do.
reya276 - 29 Sep 2005 21:33 GMT
I got an error:
Error Executing Database Query.
[Macromedia][SQLServer JDBC Driver][SQLServer]Line 4: Incorrect syntax near '2005'.