Hello DNNers,
I'm using ActionGrid & ActionForm to build a directory of businesses.
I'm entering business listings into my own custom table and so far i've imported quite a few records from excel through SQL MS but the states/regions & Countries are spelled out instead of numeric values which I imagine is how DNN is storing them?
In my sort box (form) i'm using the following query to pull out regions & countries.
REGIONS:
with cte as(
select 'Select a State/Region' as Region, 'All' as Value
UNION ALL
select distinct Region, Region as Value from BND_Listing
where isnull(Region,'') <> '')
select * from cte Order by case when Region = 'Select a State/Region' then 1 else 2 end, Region ASC
COUNTRIES:
with cte as(
select 'Select a Country' as Country, 'All' as Value
UNION ALL
select distinct Country, Country as Value from BND_Listing
where isnull(Country,'') <> '')
select * from cte Order by case when Country = 'Select a Country' then 1 else 2 end, Country ASC
---------------------------------------------------------
My issue arises when someone clicks either of these drop-downs i'm displaying the 2 digit region abbreviation & same for countries.
When updating my directory table what values should I use to pull region/country.
Can I just modify my select statement to transform the abbreviations to full names?
Any examples, insight appreciated.
Thank you,
Alex