1

Topic: The range job through Where... between

All greetings. It is necessary to connect bases which contain the data on products. All data from basis, but only the necessary columns and those lines which I correspond to the demanded codes of the goods on  foreign trade activities undertakes not. The problem arises in the job of a range of these codes.
The basis contains all codes beginning from 7200000000 to 7399999999, and lines,  are necessary only to the codes from 7304000000 to 7306999999.
The codes are written down in a column in a text format. Therefore at range instructions through where... between, the request works incorrectly.
Question in how it is possible to specify a range for these codes. Can be eat possibility to change a column format on the numerical? My code is resulted more low.

(SELECT ND,GD0,G071,GD1,STAT,G011,G0131,G021,G022,G081,G082,G083, G221,G222,G11,G091,G092,G093,G141,G142,G143,G15,G15A,G16,G17A,G17B,G19,G33,G32,G31_1,TEXT1,G31_11,G31_12,G06,G31_7,G31_71,G37,G34,G35,G36,G38,G39,G42,G45,G46,G474RUB,G474DOL,G202,G2021,G23
FROM 72_73 in ' D:\72_73_04_2017.mdb'
WHERE g33 between "7204000000" and "7206999999")
UNION ALL
(SELECT ND,GD0,G071,GD1,STAT,G011,G0131,G021,G022,G081,G082,G083, G221,G222,G11,G091,G092,G093,G141,G142,G143,G15,G15A,G16,G17A,G17B,G19,G33,G32,G31_1,TEXT1,G31_11,G31_12,G06,G31_7,G31_71,G37,G34,G35,G36,G38,G39,G42,G45,G46,G474RUB,G474DOL,G202,G2021,G23
FROM 72_73 in ' D:\72_73_05_2017.mdb'
WHERE g33 between "7204000000" and "7206999999")
UNION ALL
(SELECT ND,GD0,G071,GD1,STAT,G011,G0131,G021,G022,G081,G082,G083, G221,G222,G11,G091,G092,G093,G141,G142,G143,G15,G15A,G16,G17A,G17B,G19,G33,G32,G31_1,TEXT1,G31_11,G31_12,G06,G31_7,G31_71,G37,G34,G35,G36,G38,G39,G42,G45,G46,G474RUB,G474DOL,G202,G2021,G23
FROM 06 in ' D:\72_73_06_2017.mdb'
WHERE g33 between "7204000000" and "7206999999")
UNION ALL
(SELECT ND,GD0,G071,GD1,STAT,G011,G0131,G021,G022,G081,G082,G083, G221,G222,G11,G091,G092,G093,G141,G142,G143,G15,G15A,G16,G17A,G17B,G19,G33,G32,G31_1,TEXT1,G31_11,G31_12,G06,G31_7,G31_71,G37,G34,G35,G36,G38,G39,G42,G45,G46,G474RUB,G474DOL,G202,G2021,G23
FROM 7 in ' D:\72_73_07_2017.mdb'
WHERE g33 between "7204000000" and "7206999999")
UNION ALL
(SELECT ND,GD0,G071,GD1,STAT,G011,G0131,G021,G022,G081,G082,G083, G221,G222,G11,G091,G092,G093,G141,G142,G143,G15,G15A,G16,G17A,G17B,G19,G33,G32,G31_1,TEXT1,G31_11,G31_12,G06,G31_7,G31_71,G37,G34,G35,G36,G38,G39,G42,G45,G46,G474RUB,G474DOL,G202,G2021,G23
FROM 72_73 in ' D:\72_73_08_2017.mdb'
WHERE g33 between "7204000000" and "7206999999")
UNION ALL
(SELECT ND,GD0,G071,GD1,STAT,G011,G0131,G021,G022,G081,G082,G083, G221,G222,G11,G091,G092,G093,G141,G142,G143,G15,G15A,G16,G17A,G17B,G19,G33,G32,G31_1,TEXT1,G31_11,G31_12,G06,G31_7,G31_71,G37,G34,G35,G36,G38,G39,G42,G45,G46,G474RUB,G474DOL,G202,G2021,G23
FROM 72_73 in ' D:\72_73_04_2016.mdb'
WHERE g33 between "7204000000" and "7206999999");

2

Re: The range job through Where... between

? val ("7206999999")> val ("7204000000")
True

3

Re: The range job through Where... between

bubucha;
I can not understand, as it should look in my code. Write please, already on everyone tried)

4

Re: The range job through Where... between

kudim wrote:

the Basis contains all codes beginning from 7200000000 to 7399999999, and lines,  are necessary only to the codes from 7304000000 to 7306999999.
The codes are written down in a column in a text format. Therefore at range instructions through where... between, the request works incorrectly.

Should, it is simply obliged, to work correctly if the data is correct (all codes - strictly ten-character and do not contain other characters, except digits).

5

Re: The range job through Where... between

Akina;
You are right! I specified not that range of the codes in the conditions of selection. Thanks!))