I would like to make a prompt which handles different kind of objects in a hierarchie. I would like to ask first: which level do you want to see? (country or city) and after that select the object choosen.
Something like this (but this code gives an error):
SELECT
Name, Country, city, street
FROM
HRWH.dbo.personeel_adres,
HRWH.dbo.org_dim
WHERE
( HRWH.dbo.personeel_adres.org_dim_id=HRWH.dbo.org_dim.org_dim_id )
AND (
( CASE WHEN @prompt('What do you want to see? ','A',,,) = 'Country' THEN
( convert(char,HRWH.dbo.org_dim.country_id) ) LIKE @Prompt('Country','A','Organisatiestructuur\CountryCode',,) else ( convert(char,HRWH.dbo.org_dim.city_id) ) LIKE @Prompt('City','A','Organisatiestructuur\CityCode',,) end )
)
Or does anyone has solution to solve this problem. I want to make a ‘General’ (one) report (emplid, name, adres) but the level choosen can be different; all emplid of a choosen country or all emplid of a choosen city. So I don’t have to make 2 identical reports whith different prompt.
Thanks
[edited, added bbc CODE formatting to SQL code - Andreas]
Lia (BOB member since 2004-08-24)