Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CommandType Text use a Variable 1

Status
Not open for further replies.

RovirozM

Technical User
Dec 9, 2009
37
MX
Hi Guys,

I'm trying to create a New DataSet with the option of putting CommandType as "Text" on my Report and this is what is working now:


Select Company_Code,
Department,
From MyTable
Where Accounting_Month = @Month

But I Would like to manage the "MyTable" HardCode into a Variable as this one:

Select Company_Code,
Department,
From @MyTable
Where Accounting_Month = @Month

@MyTable because I would like to use it as a parameter as I use @Month....

it is possible this one using CommandType Text?

What Kind of language is on commandtype Text, T-SQL?

Thanks!
 
First, create a DataSet without any variables. Then, edit the Expression of the DataSet query, to something like the following:

Code:
="SELECT Company_Code, Department FROM " & Parameters!TableNameParameter.Value & " WHERE Accounting_Month = " & Parameters!MonthParameter.Value
 
and, yes, commandtype is t-sql, it gets sent to sql server and executed there.

although it may be possible to set your data source to another db engine, in which case, the commandtype will need to be whatever that db engine uses.
I've never tried this myself, so don't quote me on this...

--------------------
Procrastinate Now!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top