J
Jon
I have the following SQL, which I want to put into a dataset. Later, I
want to be able to select a portion of the dataset, based on say the
regionnumber or the regionnumber and divisionnumber. I was reading up
on datasets and views and I'm a bit confused exactly how to go about
doing this. Can someone point me in the right direction or show a code
sample that does what I'm after? I'd appreciate it! Thanks
select
sr.regionnumber,
replace(sr.description,'""','') regiondescr,
sd.divisionnumber,
replace(sd.description,'""','') divdescr,
sdist.districtnumber,
replace(sdist.description,'""','') distdescr,
cs.customersitenumber,
replace(cs.name,'""','') sitename
from
salesregion sr, salesdivision sd,salesdistrict sdist, customersite cs
where sd.regionnumber=sr.regionnumber
and sdist.regionnumber=sd.regionnumber
and sdist.divisionnumber=sd.divisionnumber
and cs.regionnumber=sdist.regionnumber
and cs.divisionnumber=sdist.divisionnumber
and cs.districtnumber=sdist.districtnumber
and sr.dateclosed is null
and sd.dateclosed is null
and sdist.dateclosed is null
and cs.datepermclosed is null
order by sr.description, sd.description, sdist.description, cs.name
want to be able to select a portion of the dataset, based on say the
regionnumber or the regionnumber and divisionnumber. I was reading up
on datasets and views and I'm a bit confused exactly how to go about
doing this. Can someone point me in the right direction or show a code
sample that does what I'm after? I'd appreciate it! Thanks
select
sr.regionnumber,
replace(sr.description,'""','') regiondescr,
sd.divisionnumber,
replace(sd.description,'""','') divdescr,
sdist.districtnumber,
replace(sdist.description,'""','') distdescr,
cs.customersitenumber,
replace(cs.name,'""','') sitename
from
salesregion sr, salesdivision sd,salesdistrict sdist, customersite cs
where sd.regionnumber=sr.regionnumber
and sdist.regionnumber=sd.regionnumber
and sdist.divisionnumber=sd.divisionnumber
and cs.regionnumber=sdist.regionnumber
and cs.divisionnumber=sdist.divisionnumber
and cs.districtnumber=sdist.districtnumber
and sr.dateclosed is null
and sd.dateclosed is null
and sdist.dateclosed is null
and cs.datepermclosed is null
order by sr.description, sd.description, sdist.description, cs.name