将备注字段转换为文本并消除多余的空格

时间:2010-07-15 04:16:04

标签: ms-access-2007

我尝试在google中查找,但无法找到任何内容......我正在运行Access 2007 / XP / SQLBASE并需要进行查询,将备注字段转换为文本并删除超过2个空格的任何空格。请根据我的下面的代码段给我SQL。备注字段称为“BITS”。我曾经能够使用“SL”功能完成此任务,但它似乎无法在Access2007中工作,但在Access 2000中可以工作。非常感谢您的帮助`

SELECT SYSADM_CUST_ORDER_BINARY.CUST_ORDER_ID, SYSADM_CUST_ORDER_BINARY.BITS
FROM SYSADM_CUST_ORDER_BINARY
GROUP BY SYSADM_CUST_ORDER_BINARY.CUST_ORDER_ID, SYSADM_CUST_ORDER_BINARY.BITS;

1 个答案:

答案 0 :(得分:0)

您可以在Access 2007中使用替换:

SELECT SYSADM_CUST_ORDER_BINARY.CUST_ORDER_ID,
    Replace(SYSADM_CUST_ORDER_BINARY.BITS & "", "  ", " ")
FROM SYSADM_CUST_ORDER_BINARY 
GROUP BY SYSADM_CUST_ORDER_BINARY.CUST_ORDER_ID, 
    Replace(SYSADM_CUST_ORDER_BINARY.BITS & "", "  ", " ") 

我从未遇到过SL。