cancel
Showing results for 
Search instead for 
Did you mean: 

SQL Query filter statement

mashfaq
Contributor
0 Kudos

Dear experts,

                In IRPT file. I have selection screen Equipment, Date (Single not in range) and Production Area. after selection, when I click get notification detail, system run SQL query and get all record. In Query filter expression having confusion.

Query Detail is given below:

Table Notification detail

Column All column

In SQL query filter expression:

My table have also Equipment, date and production area columns

Notification detail.equipment = '[param.1]'   this does not work

Notification detail.date = '[param.2]'   this does not work

Notification detail.area = '[param.3]'   this does not work

But when I write:

Notification detail.area = 'Crusher'   this work

I want to filter data by combination of two fields, 1st equipment number exist and 2nd notification does not exist.

If Equiment number does not exist, system return --- value in equipment column and same for notification.

Thanks

Best Regards,

Muhammad Ashfaq

Accepted Solutions (1)

Accepted Solutions (1)

jcgood25
Active Contributor
0 Kudos

Make sure the P in param.x is capitalized inside your query template.

mashfaq
Contributor
0 Kudos

Dear Sir,

           Thanks for your kind support. Problem have been solved by replacing '[param.1]' with [Param.1].

Muhammad Ashfaq

Answers (1)

Answers (1)

agentry_src
Active Contributor
0 Kudos

Hi Muhammad,

Are you doing your query in a Query Template as Fixed Query or as Query mode?  If you are having trouble in Query mode, you should try writing the straight SQL syntax query in Fixed Query mode to see where the problem with the query originates.

Regards, Mike

mashfaq
Contributor
0 Kudos

Dear Sir,

            Yes, I am using Query mode and Fixed query mode is showing gray field means selectness.

agentry_src
Active Contributor
0 Kudos

Hi Muhammad,

Can you provide your query in straight SQL script?  It looks like you want a multi-level query with outside joins unioned together.

Regards, Mike

mashfaq
Contributor
0 Kudos

Dear Sir,

            Yes, I am using Query mode and Fixed query mode is showing gray field means selectness.

Thanks

Best Regards,

Muhammad Ashfaq

agentry_src
Active Contributor
0 Kudos

If your fields are numeric in nature, do not use the single tic marks around [Param.X].  You may also want to check your text to make sure the cases are correct.

Also, if you want to directly script the query, you will need to change the mode to Fixed Query from Query.  Otherwise Fixed Query will remain greyed out.  Once changed to Fixed Query, Query will become greyed out.  You can only use one or the other mode.  They can't both be active at the same time.

Regards, Mike