Re: More help with query
From: Newbie (noidea_at_nospam.com)
Date: 03/10/04
- Next message: Steve Kass: "Re: Running totals on a select count statement"
- Previous message: Rohtash Kapoor: "Re: Help with query"
- In reply to: Newbie: "Re: More help with query"
- Next in thread: Vishal Parkar: "Re: More help with query"
- Reply: Vishal Parkar: "Re: More help with query"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 10 Mar 2004 17:26:24 -0000
I have the following which works ok but I don't want to have to put a quote
no in.
UPDATE SOQuot
SET TotalQty = (Select sum(OrderQty) FROM SODet
INNER Join SO ON SO.SalesOrder = SODet.SalesOrder
WHERE SO.Quote = '00009219' and SODet.Line = '1')
WHERE SOQuot.QuoteNo = '00009219'
If I change the 2nd where clause to SOQuot.QuoteNo = SO.Quote - I get the
message:
The column prefix 'SorMaster' does not match with a table name or alias name
used in the query.
What am I doing wrong
Thanks
"Newbie" <noidea@nospam.com> wrote in message
news:eTcJEFsBEHA.3472@TK2MSFTNGP09.phx.gbl...
> Oops forgot the sum(SODet.OrderQty) need to be limited to records with
> LineType = '1'
>
> Thanks
> "Newbie" <noidea@nospam.com> wrote in message
> news:%23R8YLDsBEHA.1380@TK2MSFTNGP10.phx.gbl...
> > Variation on prev post . . .
> >
> > I have 3 tables
> >
> > SO
> > SODet, and
> > SOQuot
> >
> > SO is linked to SODet by SalesOrder
> > SO is linked to SOQuot by Quote
> >
> > I want to update SOQuot.TotalQty with the result of Sum(SODet.OrderQty)
> >
> > What would the syntax be for this?
> >
> > Thanks
> >
> >
>
>
- Next message: Steve Kass: "Re: Running totals on a select count statement"
- Previous message: Rohtash Kapoor: "Re: Help with query"
- In reply to: Newbie: "Re: More help with query"
- Next in thread: Vishal Parkar: "Re: More help with query"
- Reply: Vishal Parkar: "Re: More help with query"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
|