December 4, 2008 at 9:20 am
DATABASE NAME:abc
TABLE NAME:GEOGRAPHY_DIM
COLUMN NAME: STATE
In State i have values eg: "NJ", "DC","NY", "MI"
In State column i need a value : "ALL"
I need out put as: "ALL","NJ", "DC","NY", "MI"
I need to execute this query in teradata.I
when i run this query in SSRS2000 i need to get a Dropbox on StateName as "ALL","NJ", "DC","NY", "MI" when i select "NJ" it has to display NJ Data. when i select "ALL" it has to display data for all states.
Please help me to get data when i select "ALL".
Thanks in Advance
Sharma
December 4, 2008 at 10:07 am
I don't know query syntax for teradata, but you need to use an expression in your query. Something like this:
="Select columns from tables " & IIF(Parameters!State.Value = "ALL", "", "Where state = '" & Parameters!State.Value & "'"
Jack Corbett
Consultant - Straight Path Solutions
Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
December 13, 2008 at 11:51 am
I'm not sure of the Teradata syntax either, I'm afraid, but I would construct directly it in the SQL statement this way:
SELECT ... FROM ... WHERE StateName = @state_parameter OR @state_parameter = 'ALL'
This is the way I achieve it in SQL server and I'm sure it can be translate it as required.
Good luck
Paul J
December 15, 2008 at 11:58 am
SSRS 2005 has an ALL option built in. Without that, consider creating a table with your states in it. Also include and additional entry in the table for 'ALL' that returns your string with all states in it....
AL = AL
TN = TN
NE = NE
ALL = AL, TN, NE, ....
Then in your report parameter you can say
where mystate in (@stateparm)
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply