cancel
Showing results for 
Search instead for 
Did you mean: 

Creating Report

Former Member
0 Kudos

Hai To All,

Using Query Gerenator i have created the report but now my lighting is that while generating report it want to ask the input for me how i can do it in query?

Reagards,

Anitha

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Ani,

plz clear me that r u using Visual Studio 2005 with SQL Server 2005 or something else?

Bcz i used this configuration.....so in this regard i ll be able to short out your problem.

Kind Regards

Yogesh

former_member583013
Active Contributor
0 Kudos

Hello Ani,

You can specify input parameters by using Field = '[%0]', Field = '[%1]'

Example:

SELECT T0.DocNum, T0.CardCode, T0.CardName, T0.DocDate, T0.DocTotal

FROM [dbo].[ORDR] T0

WHERE T0.CardName = '[%0]'

In the above query I have used T0.CardName = '[%0]' in the Parameter Selection where the query will prompt the user to Select the CardName and show all results matching the CardName.

You could also use criteria <b>T0.CardName LIKE '%[%0]%'</b>

or

T0.CardName = '[%0]' AND T0.DocDate = '[%1]'

For each additional parameter you would use a different %number

Hope it helps

Suda

Former Member
0 Kudos

Suda,

I have already tried that but i cant get the answer

For Example:

SELECT * from information_schema.tables where table_name='%[%0]%'

It should show the input box but no reaction over there...

Regards,

Anitha

former_member204969
Active Contributor
0 Kudos

The [%0] parameter request is usable only with column names known inside SBO.

Former Member
0 Kudos

Hi Anitha,

Input parameters can be anycolumn from SBO tables Where as the information_schema.tables is the table created by SQL server it is not SBO table So we can not use Input Parameter for the columns in that table

Regards

Vishnu

Former Member
0 Kudos

Vishnu,

Ok i it but for example if i use

Select * from [@PUR_PI_HEAD] where U_plantid='[%0]'

It not generating??? Why??

Regards,

Anitha

former_member204969
Active Contributor
0 Kudos

Try this:

Select * from [dbo].[@PUR_PI_HEAD] where U_plantid='[%0]'

Former Member
0 Kudos

Hi Anitha

I have tested it

SELECT * FROM [DBO].[@PUR_PI_HEAD] TO WHERE TO.U_plantid='%[%0]%'

This will help you

Regards

Vishnu

Former Member
0 Kudos

No Vishnu its not working..........

The Error is:

1) [Microsoft][ODBC SQL Server Driver][SQL Server]Must Specify table to select from

2)[Microsoft][ODBC SQL Server Drier][SQL Server]Statement

Regards,

Anitha

Former Member
0 Kudos

Hi

that is because of key word TO

SELECT * FROM [DBO].[@PUR_PI_HEAD] T1 WHERE T1.U_plantid='%[%0]%'

This is working

Regards

Vishnu

Former Member
0 Kudos

IF your field is numeric use this query

SELECT * FROM [DBO].[@PUR_PI_HEAD] T1 WHERE T1.U_plantid='[%0]'