Results 1 to 2 of 2

Thread: help.. converting query from MS Access to SQL

  1. #1
    Join Date
    Nov 2002
    Posts
    1

    Question help.. converting query from MS Access to SQL

    Please help. I have the following query that runs in access and I need to make it run directly on SQL Server 2K. I did not build this access query and I have never used a join quite like this. Any help would be appreciated.

    UPDATE tblItm
    INNER JOIN (ItmStr INNER JOIN StrReqRvw ON
    (StrReqRvw.StNo = ItmStr.StrNo) AND
    (ItmStr.UPC = StrReqRvw.UPC)) ON tblItm.UPC = StrReqRvw.UPC
    SET ItmStr.StrReqQty = 0
    WHERE (((StrReqRvw.ReqDt) Like '11/04/02')
    AND ((tblItm.StckFlg)<>"SQ" And (tblItm.StckFlg)<>"PR"));

    Thanks

  2. #2
    Join Date
    Nov 2002
    Posts
    8
    I am not sure if this is exactly what you need because the update query is so out of order. Is this part of VBA code? If it is just a stand alone update query then this should replace it for SQL Server:

    update itmstr

    set strreqqty = 0

    from
    itmstr a inner join strreqrvw b
    on a.stno = b.strno and
    a.upc = b.upc
    inner join tblitm c
    on c.upc = b.upc

    where
    b.reqdt like '11/04/02'
    and c.stckflg <> 'sq'
    and c.stckflg <> 'pr'

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •