cancel
Showing results for 
Search instead for 
Did you mean: 

Convert Sub-Report to Crystal Command

Former Member
0 Kudos
50

I'm attempting to convert a sub-report and a shared variable from the report to a Command.

Can someone help with the conversion


Here is the part of the Crystal SQL I can't convert

This is within last7days >>>  (ORDER_PROC.ORDER_INST>={ts '2014-06-18 00:00:00'} AND ORDER_PROC.ORDER_INST<{ts '2014-06-25 00:00:00'})

AND ((ORDER_PROC.RESULT_TIME IS  NULL ) OR (ORDER_PROC.RESULT_TIME>=ORDER_PROC.ORDER_INST))
ORDER BY ORDER_PROC.ORDER_INST

Here is the code for the shared variable

if (not isnull({ORDER_PROC_3.FREQ_UNSCHEDULED_C}) and {ORDER_PROC_3.FREQ_UNSCHEDULED_C}=1 ) then {ORDER_PROC.ORDER_INST}

else {ORDER_PROC.PROC_START_TIME}


Thanks

Steve

Accepted Solutions (0)

Answers (1)

Answers (1)

JWiseman
Active Contributor
0 Kudos

hi Steve,

you'd need to give us some info...what database are you using? Commands use syntax native to your database.

are you trying to get the last 7 days instead of a hard coded date range?

the following may take care of the date range and the null should you be using sql server..not sure though as i don't have the db to check against. i would suggest that you search a forum for your database for the correct syntax though.

WHERE

DATEDIFF(DAY,ORDER_PROC.ORDER_INST, GETDATE()) <= 7

AND

(

     ISNULL(ORDER_PROC.RESULT_TIME)

     OR

     ORDER_PROC.RESULT_TIME>=ORDER_PROC.ORDER_INST

)

ORDER BY

ORDER_PROC.ORDER_INST

also you can't use a Shared Variable directly in a command object but you can certainly pass it in via a sub-report link. what is the variable supposed to do in the command? suggest that you create a Parameter in the command object and then link the subreport from your main report to the command parameter.

cheers,

jamie