Thinker

Would you like to react to this message? Create an account in a few clicks or log in to continue.
Thinker

Forum for story


2 posters

    跨Table赋值/拿数据

    Aueeins
    Aueeins
    呢喃的歌声


    帖子数 : 205
    积分 : 5229
    威望 : 0
    注册日期 : 2011-09-08
    地点 : SG

    跨Table赋值/拿数据 Empty 跨Table赋值/拿数据

    Post by Aueeins 2011-09-19, 9:24 pm







    select * from m02sales WHERE VOUCHERNUMBER='AR201109-0003' 主要的发票单




    SELECT TOP 1 REFTYPE FROM m02salesDET WHERE VOUCHERNUMBER='AR201109-0003' AND SUBCODE='RICS' ORDER BY CODE 4个中的最主要的第一个产品信息




    SELECT ITEMSNO FROM M21RENTALITEMS WHERE RENTITEMID='REIT201109-000001' 根据产品号 找到了他的序列号



    UPDATE m02sales SET MAINDETREF ='????????????????????' WHERE VOUCHERNUMBER='AR201109-0003' update回去到主要的发票单的下脚



    UPDATE m02sales SET MAINDETREF =(SELECT ITEMSNO FROM M21RENTALITEMS WHERE RENTITEMID=(SELECT TOP 1 REFTYPE FROM m02salesDET WHERE VOUCHERNUMBER='AR201109-0003' AND SUBCODE='RICS' ORDER BY CODE )) WHERE VOUCHERNUMBER='AR201109-0003'



    cls00connection.update("UPDATE m02sales SET MAINDETREF =(SELECT ITEMSNO FROM M21RENTALITEMS WHERE RENTITEMID=(SELECT TOP 1 REFTYPE FROM m02salesDET WHERE VOUCHERNUMBER='" & cls00regional.string_filter(strVOUCHERNUMBER) & "'AND SUBCODE='RICS' ORDER BY CODE )) WHERE VOUCHERNUMBER='" & cls00regional.string_filter(strVOUCHERNUMBER) & "'")




    markeloff
    markeloff
    无尽星空


    帖子数 : 326
    积分 : 5426
    威望 : 0
    注册日期 : 2011-09-06
    年龄 : 35
    地点 : Singapore

    跨Table赋值/拿数据 Empty Re: 跨Table赋值/拿数据

    Post by markeloff 2011-09-20, 12:46 pm

    拼SQL语句

      Current date/time is 2024-11-25, 4:31 pm