wysiwygGER01
Programmer
Hi,
I'm using CR 10.
My report takes very long to run so I set up the below selection statements to speed up the time it takes to produce my report.
When I look at the SQL query though it seems to ignore the statement where I try to limit my results for 1 year only.
"year(pwformatdate({GLPOST.JRNLDATE})) = ToNumber({?Year})"
It therefore returns records for all years.
Am I doing something wrong or is this the way it works?
This is my SQL query returned from Crystal.
I'm using CR 10.
My report takes very long to run so I set up the below selection statements to speed up the time it takes to produce my report.
Code:
(if {?AllCountries}<>"1" then {@Country} ={?SpecificCountry} else {@Country} <>"")
AND year(pwformatdate({GLPOST.JRNLDATE})) = ToNumber({?Year})
AND {GLPOST.SRCETYPE} <> "CL"
AND (MID({GLPOST.ACCTID},3,4) = "5340"
OR MID({GLPOST.ACCTID},3,4) = "5342"
OR MID({GLPOST.ACCTID},3,4) = "5722"
OR MID({GLPOST.ACCTID},3,4) = "5210"
OR MID({GLPOST.ACCTID},3,4) IN ["4110" TO "4430"])
AND {GLPOST.JRNLDATE} >= 0 AND pwformatdate({GLPOST.JRNLDATE}) <= {@EndDate}
When I look at the SQL query though it seems to ignore the statement where I try to limit my results for 1 year only.
"year(pwformatdate({GLPOST.JRNLDATE})) = ToNumber({?Year})"
It therefore returns records for all years.
Am I doing something wrong or is this the way it works?
This is my SQL query returned from Crystal.
Code:
SELECT "GLAMF"."ACSEGVAL02", "GLAMF"."ACSEGVAL03", "GLAMF"."ACCTDESC", "GLPOST"."ACCTID", "GLPOST"."SRCETYPE", "GLPOST"."JRNLDATE", "GLPOST"."TRANSAMT"
FROM "cap100"."dbo"."GLAMF" "GLAMF" INNER JOIN "cap100"."dbo"."GLPOST" "GLPOST" ON "GLAMF"."ACCTID"="GLPOST"."ACCTID"
WHERE "GLPOST"."SRCETYPE"<>'CL' AND "GLPOST"."JRNLDATE">=0