I am using iReport and want to be able to take 4 date inputs (2 date ranges) dateRange1
and dateRange2
.
Each will disaplay the amount of items and cost given within the respected ranges.
So far I have the first dateRange1
is working but I am having trouble figuring out to implament the second date range.
Here is the code I have along with some screenshots.
SELECT
COMPANY."NAME" AS COMPANY_NAME,
CUSTOMER."NAME" AS CUSTOMER_NAME,
SO."NUM" AS SO_NUM,
SOITEM."STATUSID" AS SOITEM_STATUSID,
PRODUCT."ID" AS PRODUCT_ID,
PART."NUM" AS PART_NUM,
SOITEM."QTYFULFILLED" AS SOITEM_QTYFULFILLED,
SO."COST" AS SO_COST,
PART."ID" AS PART_ID,
SO."DATECOMPLETED" AS SO_DATECOMPLETED,
CUSTOMER."ID" AS CUSTOMER_ID,
SOSTATUS."ID" AS SOSTATUS_ID
FROM
"CUSTOMER" CUSTOMER INNER JOIN "SO" SO ON CUSTOMER."ID" = SO."CUSTOMERID"
INNER JOIN "SOITEM" SOITEM ON SO."ID" = SOITEM."SOID"
INNER JOIN "SOSTATUS" SOSTATUS ON SO."STATUSID" = SOSTATUS."ID"
INNER JOIN "PRODUCT" PRODUCT ON SOITEM."PRODUCTID" = PRODUCT."ID"
INNER JOIN "PART" PART ON PRODUCT."ID" = PART."DEFAULTPRODUCTID"
AND PART."ID" = PRODUCT."PARTID",
"COMPANY" COMPANY
WHERE
UPPER(CUSTOMER."NAME") = $P{customerID}
AND SO."DATECOMPLETED" BETWEEN $P{From} AND $P{To}
This wis a screenshot of the design view.