Showing posts with label directly. Show all posts
Showing posts with label directly. Show all posts

Wednesday, March 21, 2012

Newbie query question

I need to include data from a table which is not directly related to
the "hub" table, and am kinda stuck.
I doubted it would work (tried anyhow), but this is the code from my
attempt:
SELECT
ConsignmentCodes.CodeDesc,
Stockline.ConsignmentCode,
Reserve.SalesOrderId,
Invoice.ShipDate,
Part.Number,
Reserve.Shipped as Qty,
SOItem.UnitAmount,
(Reserve.Shipped*SOItem.UnitAmount) as Total,
1-(ConsignmentCodes.CodeCommRate*.01) as ConsignorPercent
FROM Stockline JOIN Part ON (Stockline.PartId=Part.PartId)
LEFT JOIN Reserve ON (Stockline.StockId=Reserve.StockId)
LEFT JOIN ConsignmentCodes ON
(Stockline.ConsignmentCode=ConsignmentCodes.Consig nmentCode)
LEFT JOIN SOItem ON (Stockline.PartId=SOItem.PartId)
WHERE Reserve.SalesOrderId=Invoice.SalesOrderId
AND Reserve.InvoiceId=Invoice.InvoiceId
You can see why it did didn't work, and hopefully, what I am trying to
do.
I need "Invoice.ShipDate", but "Invoice" doesn't have any fields which
relate to "Stockline".
If I try to base all my relationships on "Resreve", then I end up with
ths same problem for "Part".
What's my next step?
-Mo
On Feb 22, 2:41Xpm, Lucas Kartawidjaja
<LucasKartawidj...@.discussions.microsoft.com> wrote:
> Without knowing the table structure and their relationship, I would suggest
> try the following query or something close:
> SELECT
> X X X X ConsignmentCodes.CodeDesc,
> X X X X Stockline.ConsignmentCode,
> X X X X Reserve.SalesOrderId,
> X X X X Invoice.ShipDate,
> X X X X Part.Number,
> X X X X Reserve.Shipped as Qty,
> X X X X SOItem.UnitAmount,
> X X X X (Reserve.Shipped*SOItem.UnitAmount) as Total,
> X X X X 1-(ConsignmentCodes.CodeCommRate*.01) as ConsignorPercent
> FROM X XStockline LEFT OUTER JOIN Part ON (Stockline.PartId=Part.PartId)
> X X X X LEFT OUTER JOIN Reserve ON (Stockline.StockId=Reserve.StockId)
> X X X X LEFT OUTER JOIN ConsignmentCodes ON
> X X X X X X X X (Stockline.ConsignmentCode=ConsignmentCodes.Consig nmentCode)
> X X X X LEFT OUTER JOIN SOItem ON (Stockline.PartId=SOItem.PartId)
> X X X X LEFT OUTER JOIN Invoice ON (Reserve.SalesOrderId=Invoice..SalesOrderId)
> X X X X AND (Reserve.InvoiceId=Invoice.InvoiceId)
> Lucas
>
> "Mehile.Orl...@.gmail.com" wrote:
>
>
>
> - Show quoted text -
Thanks, I think that gets me going again.
If I run into anything else, I'll repost.
Mo
sql

Newbie query question

I need to include data from a table which is not directly related to
the "hub" table, and am kinda stuck.
I doubted it would work (tried anyhow), but this is the code from my
attempt:
SELECT
ConsignmentCodes.CodeDesc,
Stockline.ConsignmentCode,
Reserve.SalesOrderId,
Invoice.ShipDate,
Part.Number,
Reserve.Shipped as Qty,
SOItem.UnitAmount,
(Reserve.Shipped*SOItem.UnitAmount) as Total,
1-(ConsignmentCodes.CodeCommRate*.01) as ConsignorPercent
FROM Stockline JOIN Part ON (Stockline.PartId=Part.PartId)
LEFT JOIN Reserve ON (Stockline.StockId=Reserve.StockId)
LEFT JOIN ConsignmentCodes ON
(Stockline.ConsignmentCode=ConsignmentCodes.ConsignmentCode)
LEFT JOIN SOItem ON (Stockline.PartId=SOItem.PartId)
WHERE Reserve.SalesOrderId=Invoice.SalesOrderId
AND Reserve.InvoiceId=Invoice.InvoiceId
You can see why it did didn't work, and hopefully, what I am trying to
do.
I need "Invoice.ShipDate", but "Invoice" doesn't have any fields which
relate to "Stockline".
If I try to base all my relationships on "Resreve", then I end up with
ths same problem for "Part".
What's my next step?
-MoWithout knowing the table structure and their relationship, I would suggest
try the following query or something close:
SELECT
ConsignmentCodes.CodeDesc,
Stockline.ConsignmentCode,
Reserve.SalesOrderId,
Invoice.ShipDate,
Part.Number,
Reserve.Shipped as Qty,
SOItem.UnitAmount,
(Reserve.Shipped*SOItem.UnitAmount) as Total,
1-(ConsignmentCodes.CodeCommRate*.01) as ConsignorPercent
FROM Stockline LEFT OUTER JOIN Part ON (Stockline.PartId=Part.PartId)
LEFT OUTER JOIN Reserve ON (Stockline.StockId=Reserve.StockId)
LEFT OUTER JOIN ConsignmentCodes ON
(Stockline.ConsignmentCode=ConsignmentCodes.ConsignmentCode)
LEFT OUTER JOIN SOItem ON (Stockline.PartId=SOItem.PartId)
LEFT OUTER JOIN Invoice ON (Reserve.SalesOrderId=Invoice.SalesOrderId)
AND (Reserve.InvoiceId=Invoice.InvoiceId)
Lucas
"Mehile.Orloff@.gmail.com" wrote:
> I need to include data from a table which is not directly related to
> the "hub" table, and am kinda stuck.
> I doubted it would work (tried anyhow), but this is the code from my
> attempt:
> SELECT
> ConsignmentCodes.CodeDesc,
> Stockline.ConsignmentCode,
> Reserve.SalesOrderId,
> Invoice.ShipDate,
> Part.Number,
> Reserve.Shipped as Qty,
> SOItem.UnitAmount,
> (Reserve.Shipped*SOItem.UnitAmount) as Total,
> 1-(ConsignmentCodes.CodeCommRate*.01) as ConsignorPercent
> FROM Stockline JOIN Part ON (Stockline.PartId=Part.PartId)
> LEFT JOIN Reserve ON (Stockline.StockId=Reserve.StockId)
> LEFT JOIN ConsignmentCodes ON
> (Stockline.ConsignmentCode=ConsignmentCodes.ConsignmentCode)
> LEFT JOIN SOItem ON (Stockline.PartId=SOItem.PartId)
> WHERE Reserve.SalesOrderId=Invoice.SalesOrderId
> AND Reserve.InvoiceId=Invoice.InvoiceId
> You can see why it did didn't work, and hopefully, what I am trying to
> do.
> I need "Invoice.ShipDate", but "Invoice" doesn't have any fields which
> relate to "Stockline".
> If I try to base all my relationships on "Resreve", then I end up with
> ths same problem for "Part".
>
> What's my next step?
> -Mo
>|||On Feb 22, 2:41=A0pm, Lucas Kartawidjaja
<LucasKartawidj...@.discussions.microsoft.com> wrote:
> Without knowing the table structure and their relationship, I would sugges=t
> try the following query or something close:
> SELECT
> =A0 =A0 =A0 =A0 ConsignmentCodes.CodeDesc,
> =A0 =A0 =A0 =A0 Stockline.ConsignmentCode,
> =A0 =A0 =A0 =A0 Reserve.SalesOrderId,
> =A0 =A0 =A0 =A0 Invoice.ShipDate,
> =A0 =A0 =A0 =A0 Part.Number,
> =A0 =A0 =A0 =A0 Reserve.Shipped as Qty,
> =A0 =A0 =A0 =A0 SOItem.UnitAmount,
> =A0 =A0 =A0 =A0 (Reserve.Shipped*SOItem.UnitAmount) as Total,
> =A0 =A0 =A0 =A0 1-(ConsignmentCodes.CodeCommRate*.01) as ConsignorPercent
> FROM =A0 =A0Stockline LEFT OUTER JOIN Part ON (Stockline.PartId=3DPart.Par=tId)
> =A0 =A0 =A0 =A0 LEFT OUTER JOIN Reserve ON (Stockline.StockId=3DReserve.St=ockId)
> =A0 =A0 =A0 =A0 LEFT OUTER JOIN ConsignmentCodes ON
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (Stockline.ConsignmentCode=3DConsignmentCo=des.ConsignmentCode)
> =A0 =A0 =A0 =A0 LEFT OUTER JOIN SOItem ON (Stockline.PartId=3DSOItem.PartI=d)
> =A0 =A0 =A0 =A0 LEFT OUTER JOIN Invoice ON (Reserve.SalesOrderId=3DInvoice=.SalesOrderId)
> =A0 =A0 =A0 =A0 AND (Reserve.InvoiceId=3DInvoice.InvoiceId)
> Lucas
>
> "Mehile.Orl...@.gmail.com" wrote:
> > I need to include data from a table which is not directly related to
> > the "hub" table, and am kinda stuck.
> > I doubted it would work (tried anyhow), but this is the code from my
> > attempt:
> > SELECT
> > ConsignmentCodes.CodeDesc,
> > Stockline.ConsignmentCode,
> > Reserve.SalesOrderId,
> > Invoice.ShipDate,
> > Part.Number,
> > Reserve.Shipped as Qty,
> > SOItem.UnitAmount,
> > (Reserve.Shipped*SOItem.UnitAmount) as Total,
> > 1-(ConsignmentCodes.CodeCommRate*.01) as ConsignorPercent
> > FROM Stockline JOIN Part ON (Stockline.PartId=3DPart.PartId)
> > LEFT JOIN Reserve ON (Stockline.StockId=3DReserve.StockId)
> > LEFT JOIN ConsignmentCodes ON
> > (Stockline.ConsignmentCode=3DConsignmentCodes.ConsignmentCode)
> > LEFT JOIN SOItem ON (Stockline.PartId=3DSOItem.PartId)
> > WHERE Reserve.SalesOrderId=3DInvoice.SalesOrderId
> > AND Reserve.InvoiceId=3DInvoice.InvoiceId
> > You can see why it did didn't work, and hopefully, what I am trying to
> > do.
> > I need "Invoice.ShipDate", but "Invoice" doesn't have any fields which
> > relate to "Stockline".
> > If I try to base all my relationships on "Resreve", then I end up with
> > ths same problem for "Part".
> > What's my next step?
> > -Mo- Hide quoted text -
> - Show quoted text -
Thanks, I think that gets me going again.
If I run into anything else, I'll repost.
Mo

Saturday, February 25, 2012

Newbie RDL to RDLC Conversion

Hi,
I am developing a few reports using the Micrsoft report server which
create a "RDL" file. I was wondering if I can directly transfer these
reports to my ASP.Net application and convert them to the RDLC format?
can anybody provide any information about this functionality?
ThanksAssuming they are RS 2005 files all you have to do is change the extension
and bring them into you project.
I looked at using the viewer control in local mode (which is what you are
talking about doing) and if you have a RS server around you are much better
off to use it in server mode. There is a lot of mucking around that you have
to do with local reports. For instance, for a subreport you have to wire up
an event. It is nothing all that difficult but between hooking up events,
retrieving the data etc it is a good bit more effort than just calling the
report and passing a parameter.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"Momomo" <le_mo_mo@.yahoo.com> wrote in message
news:1188354990.554512.26060@.k79g2000hse.googlegroups.com...
> Hi,
> I am developing a few reports using the Micrsoft report server which
> create a "RDL" file. I was wondering if I can directly transfer these
> reports to my ASP.Net application and convert them to the RDLC format?
> can anybody provide any information about this functionality?
> Thanks
>|||Hi,
Thank you for the response.How do I deal with "RDS (Shared Data
Source)" and "RDL.Data" files? hwo di I migrate those to my web site?
Mo|||I think you are a bit confused about how the control works. First, you are
using the reportviewer control that ships with VS 2005. It comes both as a
webform and as a winform control. Assuming you are then you need to decide
whether you want to use local mode or server mode. In server mode it
connects to RS server. You provide the parameters and it calls and then
displays the report. This is pretty straight forward to implement. In local
mode you give it the report (rdlc file) and hand it the dataset (really a
datatable). You have total control and you have to do more work.
RS does not have an RDL file on the server, it stores the object. You have
to save the report from Report Manager or get it out of the original VS
project that created the reports.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"Momomo" <le_mo_mo@.yahoo.com> wrote in message
news:1188418919.496400.315330@.57g2000hsv.googlegroups.com...
> Hi,
> Thank you for the response.How do I deal with "RDS (Shared Data
> Source)" and "RDL.Data" files? hwo di I migrate those to my web site?
> Mo
>