Hello – long time reader, first time poster.
I am working in Crystal Reports v11 with an Oracle db, and trying to use a Command to create a report. To my knowledge, I need to use a command because I am performing a UNION query. The problem is that the user would like to use a Date parameter, and that the Crystal date format is not compatible with the Oracle date format. I have seen a bunch of posts on this issue, and researched for a week or more and cannot get anything to work. Here is the Command –
SELECT "TABLE_ONE"."REQUEST_ID", "TABLE_ONE"."REQUEST_DESCRIPTION",
"TABLE_ONE"."P_NASU_DT", "TABLE_ONE"."CUST_SLS_RGN",
"TABLE_ONE"."CUST_SLSTM", "TABLE_ONE"."CREATED_BY_USERNAME",
"TABLE_ONE"."P_ORG_ANALYST",
"TABLE_ONE"."CM_PROD",
"TABLE_ONE"."NUM_ACD"
FROM "DATABASE"."TABLE_ONE" "TABLE_ONE"
WHERE ("TABLE_ONE"."P_NASU_DT">='2008-01-01' AND
"TABLE_ONE"."P_NASU_DT"<'2008-03-01')
UNION
SELECT "TABLE_TWO"."REQUEST_ID", "TABLE_TWO"."REQUEST_DESCRIPTION",
"TABLE_TWO"."P_NASU_DT", "TABLE_TWO"."CUST_SLS_RGN",
"TABLE_TWO"."CUST_SLSTM", "TABLE_TWO"."CREATED_BY_USERNAME",
"TABLE_TWO"."P_ORG_ANALYST",
"TABLE_TWO"."CM_PROD",
"TABLE_TWO"."NUM_ACD"
FROM "DATABASE"."TABLE_TWO" "TABLE_TWO"
WHERE ("TABLE_TWO"."P_NASU_DT">='2008-01-01' AND
"TABLE_TWO"."P_NASU_DT"<'2008-03-01')
This command works successfully, but there are also 24 more UNION statements I eliminated to keep this post shorter, and the query takes over 20 minutes to run.
The field P_NASU_DT validates as True in the IsDate formula, but displays as string on the Crystal report.
Example of data in P_NASU_DT: 2008-01-04 14:25:46
I would like to replace all instances of yyyy-mm-dd in the above query with a parameter.
The most common error I get when playing around with this SELECT is the Oracle error “define not done before execute and fetch”, but I am not too familiar with Oracle and research has not been too fruitful.
Any help would be greatly appreciated!
I am working in Crystal Reports v11 with an Oracle db, and trying to use a Command to create a report. To my knowledge, I need to use a command because I am performing a UNION query. The problem is that the user would like to use a Date parameter, and that the Crystal date format is not compatible with the Oracle date format. I have seen a bunch of posts on this issue, and researched for a week or more and cannot get anything to work. Here is the Command –
SELECT "TABLE_ONE"."REQUEST_ID", "TABLE_ONE"."REQUEST_DESCRIPTION",
"TABLE_ONE"."P_NASU_DT", "TABLE_ONE"."CUST_SLS_RGN",
"TABLE_ONE"."CUST_SLSTM", "TABLE_ONE"."CREATED_BY_USERNAME",
"TABLE_ONE"."P_ORG_ANALYST",
"TABLE_ONE"."CM_PROD",
"TABLE_ONE"."NUM_ACD"
FROM "DATABASE"."TABLE_ONE" "TABLE_ONE"
WHERE ("TABLE_ONE"."P_NASU_DT">='2008-01-01' AND
"TABLE_ONE"."P_NASU_DT"<'2008-03-01')
UNION
SELECT "TABLE_TWO"."REQUEST_ID", "TABLE_TWO"."REQUEST_DESCRIPTION",
"TABLE_TWO"."P_NASU_DT", "TABLE_TWO"."CUST_SLS_RGN",
"TABLE_TWO"."CUST_SLSTM", "TABLE_TWO"."CREATED_BY_USERNAME",
"TABLE_TWO"."P_ORG_ANALYST",
"TABLE_TWO"."CM_PROD",
"TABLE_TWO"."NUM_ACD"
FROM "DATABASE"."TABLE_TWO" "TABLE_TWO"
WHERE ("TABLE_TWO"."P_NASU_DT">='2008-01-01' AND
"TABLE_TWO"."P_NASU_DT"<'2008-03-01')
This command works successfully, but there are also 24 more UNION statements I eliminated to keep this post shorter, and the query takes over 20 minutes to run.
The field P_NASU_DT validates as True in the IsDate formula, but displays as string on the Crystal report.
Example of data in P_NASU_DT: 2008-01-04 14:25:46
I would like to replace all instances of yyyy-mm-dd in the above query with a parameter.
The most common error I get when playing around with this SELECT is the Oracle error “define not done before execute and fetch”, but I am not too familiar with Oracle and research has not been too fruitful.
Any help would be greatly appreciated!