我正在清理访问数据库中的某些数据,其中文本属性应为数字且&gt; 0包含非数字数据或<0的数字。
由于Access没有短路,我无法做到
create table cleaned_up as
select * from a_mess
where isNumeric(col) and col >0
是否缺少
的解决方法create table cleaned_up as
select * from (
select * from a_mess
where isNumeric(col)
)
where col > 0
答案 0 :(得分:1)
专注于SELECT
片段开始......
SELECT *
FROM a_mess
WHERE
IsNumeric(col)
AND Val(Nz(col, 0)) > 0;
然后,您可以将该查询调整为SELECT ... INTO
语句(Access UI称之为“生成表”查询)以将结果集保存为表格...
SELECT *
INTO cleaned_up
FROM a_mess
WHERE
IsNumeric(col)
AND Val(Nz(col, 0)) > 0;
答案 1 :(得分:0)
对于以非数字字符开头的字符串,它可以为Val返回0:
create table cleaned_up as
select * from a_mess
where Val(col) > 0