D
David Mueller
I can make this work but I'm fishing for a more elegant solution - one that
does not use a table.
A. I need to generate a range of consecutive numbers from thin air. From 0
to 99999. Example: 0, 1, 2, 3, ... 99997, 99998, 99999.
B. I'm using a table that holds values for the Ones place, Tens Place,
etc... up to Ten Thousands. 10 records for the "ones" place, 0 through 9. 10
records for the "tens" place, 0, 10, 20, ... 90. Etc. and so on for hundreds,
thousands, ...
I tried using a bunch of union queries in place of those 5 [SELECT...]
statements in the FROM clause, but I can't seem to make that work.
Thanks,
David
--- this is the SQL I'm using ---
SELECT [Ones]+[tens]+[hundreds]+[thousands]+[tenthousands] AS MyNum FROM
[select numbers as Ones from tbl_numbers where place_value = 1]. as
OnesPlace,
[select numbers as Tens from tbl_numbers where place_value = 10]. as
TensPlace ,
[select numbers as Hundreds from tbl_numbers where place_value = 100]. as
HundredsPlace,
[select numbers as Thousands from tbl_numbers where place_value = 1000]. as
ThousandsPlace,
[select numbers as TenThousands from tbl_numbers where place_value = 10000].
as TenThounsandsPlace
does not use a table.
A. I need to generate a range of consecutive numbers from thin air. From 0
to 99999. Example: 0, 1, 2, 3, ... 99997, 99998, 99999.
B. I'm using a table that holds values for the Ones place, Tens Place,
etc... up to Ten Thousands. 10 records for the "ones" place, 0 through 9. 10
records for the "tens" place, 0, 10, 20, ... 90. Etc. and so on for hundreds,
thousands, ...
I tried using a bunch of union queries in place of those 5 [SELECT...]
statements in the FROM clause, but I can't seem to make that work.
Thanks,
David
--- this is the SQL I'm using ---
SELECT [Ones]+[tens]+[hundreds]+[thousands]+[tenthousands] AS MyNum FROM
[select numbers as Ones from tbl_numbers where place_value = 1]. as
OnesPlace,
[select numbers as Tens from tbl_numbers where place_value = 10]. as
TensPlace ,
[select numbers as Hundreds from tbl_numbers where place_value = 100]. as
HundredsPlace,
[select numbers as Thousands from tbl_numbers where place_value = 1000]. as
ThousandsPlace,
[select numbers as TenThousands from tbl_numbers where place_value = 10000].
as TenThounsandsPlace