Hi,
I'm trying to write a SQL query within Crystal Reports Professional 9 that will retrieve a few important fields from a table and add one new field.
I would like to be able to return this in the query but if I have to create a temporary table then I will.
The main issue is, how can I actually put a field in the table (or get the query to generate it) that will be numeric and allow me to add 1 to it every time a record is returned?
For example:
If the query would return the fields Case ID and Request ID with the following values:
Case ID Request ID
200 0001928
203 0001987
224 0001092
247 0000918
255 0009108
I would want to add a field at runtime that would contain the record numbers 1 to 5. The query I currently have is:
SELECT "HPD_HelpDesk"."Case ID+", "CSD_ACT__Call_Actions"."Case ID", "CSD_ACT__Call_Actions"."Create Time", "CSD_ACT__Call_Actions"."Request ID"
FROM "HPD_HelpDesk" "HelpDesk"
INNER JOIN "CSD_ACT__Call_Actions" "CallActions" ON "HelpDesk"."Case ID+"="CallActions"."Case ID"
WHERE "HelpDesk"."Case ID+" = "CallActions"."Case ID"
ORDER BY "CallActions"."Create Time"
My knowledge of SQL is limited so there may be blatant errors here! The join may not be quite correct but I do have to join the two tables as HelpDesk will have the current Case ID+ (unique) and CallActions may have multiple occurences.
Added to this problem is the difficulty I have had in getting anything returned from the Remedy database that contains the data.
Can anyone suggest where I should start?
I'm trying to write a SQL query within Crystal Reports Professional 9 that will retrieve a few important fields from a table and add one new field.
I would like to be able to return this in the query but if I have to create a temporary table then I will.
The main issue is, how can I actually put a field in the table (or get the query to generate it) that will be numeric and allow me to add 1 to it every time a record is returned?
For example:
If the query would return the fields Case ID and Request ID with the following values:
Case ID Request ID
200 0001928
203 0001987
224 0001092
247 0000918
255 0009108
I would want to add a field at runtime that would contain the record numbers 1 to 5. The query I currently have is:
SELECT "HPD_HelpDesk"."Case ID+", "CSD_ACT__Call_Actions"."Case ID", "CSD_ACT__Call_Actions"."Create Time", "CSD_ACT__Call_Actions"."Request ID"
FROM "HPD_HelpDesk" "HelpDesk"
INNER JOIN "CSD_ACT__Call_Actions" "CallActions" ON "HelpDesk"."Case ID+"="CallActions"."Case ID"
WHERE "HelpDesk"."Case ID+" = "CallActions"."Case ID"
ORDER BY "CallActions"."Create Time"
My knowledge of SQL is limited so there may be blatant errors here! The join may not be quite correct but I do have to join the two tables as HelpDesk will have the current Case ID+ (unique) and CallActions may have multiple occurences.
Added to this problem is the difficulty I have had in getting anything returned from the Remedy database that contains the data.
Can anyone suggest where I should start?