sql server programming:
Hi Everyone, I have 3 tables -stocktbl(GSC,title,code),PK:GSC -invoicedetailtbl(GSC,Comment,quantity,fee,fk_invoicesyscode,Syscode),PK:Syscode,FK:fk_invoicesyscode -invoicetbl(customername,comment,invoiceserialno,invoicedate),PK:invoiceserialno I want to find a query of the last date and fee of objects which is stored in the stocktbl. Thanks, Nassa
Uri Dimant, The relationships bet. tables are: dbo.InvoiceTbl LEFT OUTER JOIN dbo.invoiceDetailTbl ON dbo.InvoiceTbl.InvoiceSerialNo = dbo.invoiceDetailTbl.FK_InvoiceSysCode RIGHT OUTER JOIN dbo.StockTbl ON dbo.invoiceDetailTbl.GoodSysCode = dbo.StockTbl.GoodSyscode Thanks, Nassa [quoted text, click to view] Uri Dimant wrote: > Nassa > Untested > > SELECT stocktbl.GSC,title,code FROM stocktbl JOIN invoicedetailtbl ON > stocktbl.GSC=invoicedetailtbl.stocktbl JOIN invoicetbl ON > invoicedetailtbl.fk_invoicesyscode=invoicetbl.invoiceserialno > WHERE invoicedate=(SELECT MAX(invoicedate) FROM invoicetbl I WHERE > I.invoiceserialno=invoicedetailtbl.fk_invoicesyscode) > > > > > > > > > "Nassa" <nassim.czdashti@gmail.com> wrote in message > news:1167635476.524282.243750@k21g2000cwa.googlegroups.com... > > Hi Everyone, > > > > I have 3 tables > > -stocktbl(GSC,title,code),PK:GSC > > -invoicedetailtbl(GSC,Comment,quantity,fee,fk_invoicesyscode,Syscode),PK:Syscode,FK:fk_invoicesyscode > > -invoicetbl(customername,comment,invoiceserialno,invoicedate),PK:invoiceserialno > > > > I want to find a query of the last date and fee of objects which is > > stored in the stocktbl. > > > > Thanks, > > Nassa > >
Uri Dimant, I checked that before but it gives me the wrong result. for your information: for example,if I have 4 invoices with the bellow details: In the invoice1on invoicedate 2006.8.25,goodsyscodes 1,2,3,4,5 have fees 100,100,100,100,100,respectively. In the invoice2 on invoicedate 2006.8.28,goodsyscodes 1,3,4,5 have fees 200,200,200,200,respectively. In the invoice3 on invoicedate 2006.8.30,goodsyscodes 2,4,3 have fees 300,300,300,respectively. In the invoice4 on invoicedate 2006.8.28,goodsyscodes 1 have fees 150. The results that I want: GoodSysCode LDate LFee 1 2006.8.28 200 2 2006.8.30 300 3 2006.8.30 300 4 2006.8.30 300 5 2006.8.28 200 Thanks, Nassa [quoted text, click to view] Uri Dimant wrote: > Nassa > Try this > > The relationships bet. tables are: > dbo.InvoiceTbl LEFT OUTER JOIN > dbo.invoiceDetailTbl ON > dbo.InvoiceTbl.InvoiceSerialNo = dbo.invoiceDetailTbl.FK_InvoiceSysCode > RIGHT OUTER JOIN > dbo.StockTbl ON dbo.invoiceDetailTbl.GoodSysCode > = dbo.StockTbl.GoodSyscode > > WHERE invoicedate=(SELECT MAX(invoicedate) FROM invoicetbl I WHERE > I.invoiceserialno=invoicedetailtbl.fk_invoicesyscode) > > > If it does not help, please post DDL+ sample data + an expected result > > > > > > "Nassa" <nassim.czdashti@gmail.com> wrote in message > news:1167640029.879398.74650@i12g2000cwa.googlegroups.com... > > Uri Dimant, > > > > The relationships bet. tables are: > > dbo.InvoiceTbl LEFT OUTER JOIN > > dbo.invoiceDetailTbl ON > > dbo.InvoiceTbl.InvoiceSerialNo = dbo.invoiceDetailTbl.FK_InvoiceSysCode > > RIGHT OUTER JOIN > > dbo.StockTbl ON dbo.invoiceDetailTbl.GoodSysCode > > = dbo.StockTbl.GoodSyscode > > > > Thanks, > > Nassa > > > > > > > > > > Uri Dimant wrote: > >> Nassa > >> Untested > >> > >> SELECT stocktbl.GSC,title,code FROM stocktbl JOIN invoicedetailtbl ON > >> stocktbl.GSC=invoicedetailtbl.stocktbl JOIN invoicetbl ON > >> invoicedetailtbl.fk_invoicesyscode=invoicetbl.invoiceserialno > >> WHERE invoicedate=(SELECT MAX(invoicedate) FROM invoicetbl I WHERE > >> I.invoiceserialno=invoicedetailtbl.fk_invoicesyscode) > >> > >> > >> > >> > >> > >> > >> > >> > >> "Nassa" <nassim.czdashti@gmail.com> wrote in message > >> news:1167635476.524282.243750@k21g2000cwa.googlegroups.com... > >> > Hi Everyone, > >> > > >> > I have 3 tables > >> > -stocktbl(GSC,title,code),PK:GSC > >> > -invoicedetailtbl(GSC,Comment,quantity,fee,fk_invoicesyscode,Syscode),PK:Syscode,FK:fk_invoicesyscode > >> > -invoicetbl(customername,comment,invoiceserialno,invoicedate),PK:invoiceserialno > >> > > >> > I want to find a query of the last date and fee of objects which is > >> > stored in the stocktbl. > >> > > >> > Thanks, > >> > Nassa > >> > > >
Uri Dimant, I send it to your e-mail. Thanks, Nassa [quoted text, click to view] Uri Dimant wrote: > Nassa > > Please post DDL > > CREATE TABLE blblbla (column INT......) > INSERT INTO blbalbla VALUES (1212121) > ...... > ....... > > > > > > "Nassa" <nassim.czdashti@gmail.com> wrote in message > news:1167642941.405036.24140@42g2000cwt.googlegroups.com... > > Uri Dimant, > > > > I checked that before but it gives me the wrong result. > > for your information: > > for example,if I have 4 invoices with the bellow details: > > In the invoice1on invoicedate 2006.8.25,goodsyscodes 1,2,3,4,5 have > > fees 100,100,100,100,100,respectively. > > In the invoice2 on invoicedate 2006.8.28,goodsyscodes 1,3,4,5 have > > fees 200,200,200,200,respectively. > > In the invoice3 on invoicedate 2006.8.30,goodsyscodes 2,4,3 have fees > > 300,300,300,respectively. > > In the invoice4 on invoicedate 2006.8.28,goodsyscodes 1 have fees 150. > > > > The results that I want: > > > > GoodSysCode LDate LFee > > 1 2006.8.28 200 > > 2 2006.8.30 300 > > 3 2006.8.30 300 > > 4 2006.8.30 300 > > 5 2006.8.28 200 > > > > > > Thanks, > > Nassa > > > > > > Uri Dimant wrote: > >> Nassa > >> Try this > >> > >> The relationships bet. tables are: > >> dbo.InvoiceTbl LEFT OUTER JOIN > >> dbo.invoiceDetailTbl ON > >> dbo.InvoiceTbl.InvoiceSerialNo = dbo.invoiceDetailTbl.FK_InvoiceSysCode > >> RIGHT OUTER JOIN > >> dbo.StockTbl ON dbo.invoiceDetailTbl.GoodSysCode > >> = dbo.StockTbl.GoodSyscode > >> > >> WHERE invoicedate=(SELECT MAX(invoicedate) FROM invoicetbl I WHERE > >> I.invoiceserialno=invoicedetailtbl.fk_invoicesyscode) > >> > >> > >> If it does not help, please post DDL+ sample data + an expected result > >> > >> > >> > >> > >> > >> "Nassa" <nassim.czdashti@gmail.com> wrote in message > >> news:1167640029.879398.74650@i12g2000cwa.googlegroups.com... > >> > Uri Dimant, > >> > > >> > The relationships bet. tables are: > >> > dbo.InvoiceTbl LEFT OUTER JOIN > >> > dbo.invoiceDetailTbl ON > >> > dbo.InvoiceTbl.InvoiceSerialNo = dbo.invoiceDetailTbl.FK_InvoiceSysCode > >> > RIGHT OUTER JOIN > >> > dbo.StockTbl ON dbo.invoiceDetailTbl.GoodSysCode > >> > = dbo.StockTbl.GoodSyscode > >> > > >> > Thanks, > >> > Nassa > >> > > >> > > >> > > >> > > >> > Uri Dimant wrote: > >> >> Nassa > >> >> Untested > >> >> > >> >> SELECT stocktbl.GSC,title,code FROM stocktbl JOIN invoicedetailtbl ON > >> >> stocktbl.GSC=invoicedetailtbl.stocktbl JOIN invoicetbl ON > >> >> invoicedetailtbl.fk_invoicesyscode=invoicetbl.invoiceserialno > >> >> WHERE invoicedate=(SELECT MAX(invoicedate) FROM invoicetbl I WHERE > >> >> I.invoiceserialno=invoicedetailtbl.fk_invoicesyscode) > >> >> > >> >> > >> >> > >> >> > >> >> > >> >> > >> >> > >> >> > >> >> "Nassa" <nassim.czdashti@gmail.com> wrote in message > >> >> news:1167635476.524282.243750@k21g2000cwa.googlegroups.com... > >> >> > Hi Everyone, > >> >> > > >> >> > I have 3 tables > >> >> > -stocktbl(GSC,title,code),PK:GSC > >> >> > -invoicedetailtbl(GSC,Comment,quantity,fee,fk_invoicesyscode,Syscode),PK:Syscode,FK:fk_invoicesyscode > >> >> > -invoicetbl(customername,comment,invoiceserialno,invoicedate),PK:invoiceserialno > >> >> > > >> >> > I want to find a query of the last date and fee of objects which is > >> >> > stored in the stocktbl. > >> >> > > >> >> > Thanks, > >> >> > Nassa > >> >> > > >> > > >
Uri Dimant, sorry,can u fill it urself? Thanks, Nassa [quoted text, click to view] Uri Dimant wrote: > What's about posting sample data? > > > > > "Nassa" <nassim.czdashti@gmail.com> wrote in message > news:1167646933.500920.151720@n51g2000cwc.googlegroups.com... > > Uri Dimant, > > > > I send it to your e-mail. > > > > Thanks, > > Nassa > > > > Uri Dimant wrote: > >> Nassa > >> > >> Please post DDL > >> > >> CREATE TABLE blblbla (column INT......) > >> INSERT INTO blbalbla VALUES (1212121) > >> ...... > >> ....... > >> > >> > >> > >> > >> > >> "Nassa" <nassim.czdashti@gmail.com> wrote in message > >> news:1167642941.405036.24140@42g2000cwt.googlegroups.com... > >> > Uri Dimant, > >> > > >> > I checked that before but it gives me the wrong result. > >> > for your information: > >> > for example,if I have 4 invoices with the bellow details: > >> > In the invoice1on invoicedate 2006.8.25,goodsyscodes 1,2,3,4,5 have > >> > fees 100,100,100,100,100,respectively. > >> > In the invoice2 on invoicedate 2006.8.28,goodsyscodes 1,3,4,5 have > >> > fees 200,200,200,200,respectively. > >> > In the invoice3 on invoicedate 2006.8.30,goodsyscodes 2,4,3 have fees > >> > 300,300,300,respectively. > >> > In the invoice4 on invoicedate 2006.8.28,goodsyscodes 1 have fees 150. > >> > > >> > The results that I want: > >> > > >> > GoodSysCode LDate LFee > >> > 1 2006.8.28 200 > >> > 2 2006.8.30 300 > >> > 3 2006.8.30 300 > >> > 4 2006.8.30 300 > >> > 5 2006.8.28 200 > >> > > >> > > >> > Thanks, > >> > Nassa > >> > > >> > > >> > Uri Dimant wrote: > >> >> Nassa > >> >> Try this > >> >> > >> >> The relationships bet. tables are: > >> >> dbo.InvoiceTbl LEFT OUTER JOIN > >> >> dbo.invoiceDetailTbl ON > >> >> dbo.InvoiceTbl.InvoiceSerialNo = > >> >> dbo.invoiceDetailTbl.FK_InvoiceSysCode > >> >> RIGHT OUTER JOIN > >> >> dbo.StockTbl ON dbo.invoiceDetailTbl.GoodSysCode > >> >> = dbo.StockTbl.GoodSyscode > >> >> > >> >> WHERE invoicedate=(SELECT MAX(invoicedate) FROM invoicetbl I WHERE > >> >> I.invoiceserialno=invoicedetailtbl.fk_invoicesyscode) > >> >> > >> >> > >> >> If it does not help, please post DDL+ sample data + an expected result > >> >> > >> >> > >> >> > >> >> > >> >> > >> >> "Nassa" <nassim.czdashti@gmail.com> wrote in message > >> >> news:1167640029.879398.74650@i12g2000cwa.googlegroups.com... > >> >> > Uri Dimant, > >> >> > > >> >> > The relationships bet. tables are: > >> >> > dbo.InvoiceTbl LEFT OUTER JOIN > >> >> > dbo.invoiceDetailTbl ON > >> >> > dbo.InvoiceTbl.InvoiceSerialNo = > >> >> > dbo.invoiceDetailTbl.FK_InvoiceSysCode > >> >> > RIGHT OUTER JOIN > >> >> > dbo.StockTbl ON > >> >> > dbo.invoiceDetailTbl.GoodSysCode > >> >> > = dbo.StockTbl.GoodSyscode > >> >> > > >> >> > Thanks, > >> >> > Nassa > >> >> > > >> >> > > >> >> > > >> >> > > >> >> > Uri Dimant wrote: > >> >> >> Nassa > >> >> >> Untested > >> >> >> > >> >> >> SELECT stocktbl.GSC,title,code FROM stocktbl JOIN invoicedetailtbl > >> >> >> ON > >> >> >> stocktbl.GSC=invoicedetailtbl.stocktbl JOIN invoicetbl ON > >> >> >> invoicedetailtbl.fk_invoicesyscode=invoicetbl.invoiceserialno > >> >> >> WHERE invoicedate=(SELECT MAX(invoicedate) FROM invoicetbl I WHERE > >> >> >> I.invoiceserialno=invoicedetailtbl.fk_invoicesyscode) > >> >> >> > >> >> >> > >> >> >> > >> >> >> > >> >> >> > >> >> >> > >> >> >> > >> >> >> > >> >> >> "Nassa" <nassim.czdashti@gmail.com> wrote in message > >> >> >> news:1167635476.524282.243750@k21g2000cwa.googlegroups.com... > >> >> >> > Hi Everyone, > >> >> >> > > >> >> >> > I have 3 tables > >> >> >> > -stocktbl(GSC,title,code),PK:GSC > >> >> >> > -invoicedetailtbl(GSC,Comment,quantity,fee,fk_invoicesyscode,Syscode),PK:Syscode,FK:fk_invoicesyscode > >> >> >> > -invoicetbl(customername,comment,invoiceserialno,invoicedate),PK:invoiceserialno > >> >> >> > > >> >> >> > I want to find a query of the last date and fee of objects which > >> >> >> > is > >> >> >> > stored in the stocktbl. > >> >> >> > > >> >> >> > Thanks, > >> >> >> > Nassa > >> >> >> > > >> >> > > >> > > >
Nassa Untested SELECT stocktbl.GSC,title,code FROM stocktbl JOIN invoicedetailtbl ON stocktbl.GSC=invoicedetailtbl.stocktbl JOIN invoicetbl ON invoicedetailtbl.fk_invoicesyscode=invoicetbl.invoiceserialno WHERE invoicedate=(SELECT MAX(invoicedate) FROM invoicetbl I WHERE I.invoiceserialno=invoicedetailtbl.fk_invoicesyscode) [quoted text, click to view] "Nassa" <nassim.czdashti@gmail.com> wrote in message news:1167635476.524282.243750@k21g2000cwa.googlegroups.com... > Hi Everyone, > > I have 3 tables > -stocktbl(GSC,title,code),PK:GSC > -invoicedetailtbl(GSC,Comment,quantity,fee,fk_invoicesyscode,Syscode),PK:Syscode,FK:fk_invoicesyscode > -invoicetbl(customername,comment,invoiceserialno,invoicedate),PK:invoiceserialno > > I want to find a query of the last date and fee of objects which is > stored in the stocktbl. > > Thanks, > Nassa >
Nassa Try this The relationships bet. tables are: dbo.InvoiceTbl LEFT OUTER JOIN dbo.invoiceDetailTbl ON dbo.InvoiceTbl.InvoiceSerialNo = dbo.invoiceDetailTbl.FK_InvoiceSysCode RIGHT OUTER JOIN dbo.StockTbl ON dbo.invoiceDetailTbl.GoodSysCode = dbo.StockTbl.GoodSyscode WHERE invoicedate=(SELECT MAX(invoicedate) FROM invoicetbl I WHERE I.invoiceserialno=invoicedetailtbl.fk_invoicesyscode) If it does not help, please post DDL+ sample data + an expected result [quoted text, click to view] "Nassa" <nassim.czdashti@gmail.com> wrote in message news:1167640029.879398.74650@i12g2000cwa.googlegroups.com... > Uri Dimant, > > The relationships bet. tables are: > dbo.InvoiceTbl LEFT OUTER JOIN > dbo.invoiceDetailTbl ON > dbo.InvoiceTbl.InvoiceSerialNo = dbo.invoiceDetailTbl.FK_InvoiceSysCode > RIGHT OUTER JOIN > dbo.StockTbl ON dbo.invoiceDetailTbl.GoodSysCode > = dbo.StockTbl.GoodSyscode > > Thanks, > Nassa > > > > > Uri Dimant wrote: >> Nassa >> Untested >> >> SELECT stocktbl.GSC,title,code FROM stocktbl JOIN invoicedetailtbl ON >> stocktbl.GSC=invoicedetailtbl.stocktbl JOIN invoicetbl ON >> invoicedetailtbl.fk_invoicesyscode=invoicetbl.invoiceserialno >> WHERE invoicedate=(SELECT MAX(invoicedate) FROM invoicetbl I WHERE >> I.invoiceserialno=invoicedetailtbl.fk_invoicesyscode) >> >> >> >> >> >> >> >> >> "Nassa" <nassim.czdashti@gmail.com> wrote in message >> news:1167635476.524282.243750@k21g2000cwa.googlegroups.com... >> > Hi Everyone, >> > >> > I have 3 tables >> > -stocktbl(GSC,title,code),PK:GSC >> > -invoicedetailtbl(GSC,Comment,quantity,fee,fk_invoicesyscode,Syscode),PK:Syscode,FK:fk_invoicesyscode >> > -invoicetbl(customername,comment,invoiceserialno,invoicedate),PK:invoiceserialno >> > >> > I want to find a query of the last date and fee of objects which is >> > stored in the stocktbl. >> > >> > Thanks, >> > Nassa >> > >
Nassa Please post DDL CREATE TABLE blblbla (column INT......) INSERT INTO blbalbla VALUES (1212121) ....... ........ [quoted text, click to view] "Nassa" <nassim.czdashti@gmail.com> wrote in message news:1167642941.405036.24140@42g2000cwt.googlegroups.com... > Uri Dimant, > > I checked that before but it gives me the wrong result. > for your information: > for example,if I have 4 invoices with the bellow details: > In the invoice1on invoicedate 2006.8.25,goodsyscodes 1,2,3,4,5 have > fees 100,100,100,100,100,respectively. > In the invoice2 on invoicedate 2006.8.28,goodsyscodes 1,3,4,5 have > fees 200,200,200,200,respectively. > In the invoice3 on invoicedate 2006.8.30,goodsyscodes 2,4,3 have fees > 300,300,300,respectively. > In the invoice4 on invoicedate 2006.8.28,goodsyscodes 1 have fees 150. > > The results that I want: > > GoodSysCode LDate LFee > 1 2006.8.28 200 > 2 2006.8.30 300 > 3 2006.8.30 300 > 4 2006.8.30 300 > 5 2006.8.28 200 > > > Thanks, > Nassa > > > Uri Dimant wrote: >> Nassa >> Try this >> >> The relationships bet. tables are: >> dbo.InvoiceTbl LEFT OUTER JOIN >> dbo.invoiceDetailTbl ON >> dbo.InvoiceTbl.InvoiceSerialNo = dbo.invoiceDetailTbl.FK_InvoiceSysCode >> RIGHT OUTER JOIN >> dbo.StockTbl ON dbo.invoiceDetailTbl.GoodSysCode >> = dbo.StockTbl.GoodSyscode >> >> WHERE invoicedate=(SELECT MAX(invoicedate) FROM invoicetbl I WHERE >> I.invoiceserialno=invoicedetailtbl.fk_invoicesyscode) >> >> >> If it does not help, please post DDL+ sample data + an expected result >> >> >> >> >> >> "Nassa" <nassim.czdashti@gmail.com> wrote in message >> news:1167640029.879398.74650@i12g2000cwa.googlegroups.com... >> > Uri Dimant, >> > >> > The relationships bet. tables are: >> > dbo.InvoiceTbl LEFT OUTER JOIN >> > dbo.invoiceDetailTbl ON >> > dbo.InvoiceTbl.InvoiceSerialNo = dbo.invoiceDetailTbl.FK_InvoiceSysCode >> > RIGHT OUTER JOIN >> > dbo.StockTbl ON dbo.invoiceDetailTbl.GoodSysCode >> > = dbo.StockTbl.GoodSyscode >> > >> > Thanks, >> > Nassa >> > >> > >> > >> > >> > Uri Dimant wrote: >> >> Nassa >> >> Untested >> >> >> >> SELECT stocktbl.GSC,title,code FROM stocktbl JOIN invoicedetailtbl ON >> >> stocktbl.GSC=invoicedetailtbl.stocktbl JOIN invoicetbl ON >> >> invoicedetailtbl.fk_invoicesyscode=invoicetbl.invoiceserialno >> >> WHERE invoicedate=(SELECT MAX(invoicedate) FROM invoicetbl I WHERE >> >> I.invoiceserialno=invoicedetailtbl.fk_invoicesyscode) >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> "Nassa" <nassim.czdashti@gmail.com> wrote in message >> >> news:1167635476.524282.243750@k21g2000cwa.googlegroups.com... >> >> > Hi Everyone, >> >> > >> >> > I have 3 tables >> >> > -stocktbl(GSC,title,code),PK:GSC >> >> > -invoicedetailtbl(GSC,Comment,quantity,fee,fk_invoicesyscode,Syscode),PK:Syscode,FK:fk_invoicesyscode >> >> > -invoicetbl(customername,comment,invoiceserialno,invoicedate),PK:invoiceserialno >> >> > >> >> > I want to find a query of the last date and fee of objects which is >> >> > stored in the stocktbl. >> >> > >> >> > Thanks, >> >> > Nassa >> >> > >> > >
Post your table structures, sample data & expected results. For details, see: www.aspfaq.com/5006 -- Anith
What's about posting sample data? [quoted text, click to view] "Nassa" <nassim.czdashti@gmail.com> wrote in message news:1167646933.500920.151720@n51g2000cwc.googlegroups.com... > Uri Dimant, > > I send it to your e-mail. > > Thanks, > Nassa > > Uri Dimant wrote: >> Nassa >> >> Please post DDL >> >> CREATE TABLE blblbla (column INT......) >> INSERT INTO blbalbla VALUES (1212121) >> ...... >> ....... >> >> >> >> >> >> "Nassa" <nassim.czdashti@gmail.com> wrote in message >> news:1167642941.405036.24140@42g2000cwt.googlegroups.com... >> > Uri Dimant, >> > >> > I checked that before but it gives me the wrong result. >> > for your information: >> > for example,if I have 4 invoices with the bellow details: >> > In the invoice1on invoicedate 2006.8.25,goodsyscodes 1,2,3,4,5 have >> > fees 100,100,100,100,100,respectively. >> > In the invoice2 on invoicedate 2006.8.28,goodsyscodes 1,3,4,5 have >> > fees 200,200,200,200,respectively. >> > In the invoice3 on invoicedate 2006.8.30,goodsyscodes 2,4,3 have fees >> > 300,300,300,respectively. >> > In the invoice4 on invoicedate 2006.8.28,goodsyscodes 1 have fees 150. >> > >> > The results that I want: >> > >> > GoodSysCode LDate LFee >> > 1 2006.8.28 200 >> > 2 2006.8.30 300 >> > 3 2006.8.30 300 >> > 4 2006.8.30 300 >> > 5 2006.8.28 200 >> > >> > >> > Thanks, >> > Nassa >> > >> > >> > Uri Dimant wrote: >> >> Nassa >> >> Try this >> >> >> >> The relationships bet. tables are: >> >> dbo.InvoiceTbl LEFT OUTER JOIN >> >> dbo.invoiceDetailTbl ON >> >> dbo.InvoiceTbl.InvoiceSerialNo = >> >> dbo.invoiceDetailTbl.FK_InvoiceSysCode >> >> RIGHT OUTER JOIN >> >> dbo.StockTbl ON dbo.invoiceDetailTbl.GoodSysCode >> >> = dbo.StockTbl.GoodSyscode >> >> >> >> WHERE invoicedate=(SELECT MAX(invoicedate) FROM invoicetbl I WHERE >> >> I.invoiceserialno=invoicedetailtbl.fk_invoicesyscode) >> >> >> >> >> >> If it does not help, please post DDL+ sample data + an expected result >> >> >> >> >> >> >> >> >> >> >> >> "Nassa" <nassim.czdashti@gmail.com> wrote in message >> >> news:1167640029.879398.74650@i12g2000cwa.googlegroups.com... >> >> > Uri Dimant, >> >> > >> >> > The relationships bet. tables are: >> >> > dbo.InvoiceTbl LEFT OUTER JOIN >> >> > dbo.invoiceDetailTbl ON >> >> > dbo.InvoiceTbl.InvoiceSerialNo = >> >> > dbo.invoiceDetailTbl.FK_InvoiceSysCode >> >> > RIGHT OUTER JOIN >> >> > dbo.StockTbl ON >> >> > dbo.invoiceDetailTbl.GoodSysCode >> >> > = dbo.StockTbl.GoodSyscode >> >> > >> >> > Thanks, >> >> > Nassa >> >> > >> >> > >> >> > >> >> > >> >> > Uri Dimant wrote: >> >> >> Nassa >> >> >> Untested >> >> >> >> >> >> SELECT stocktbl.GSC,title,code FROM stocktbl JOIN invoicedetailtbl >> >> >> ON >> >> >> stocktbl.GSC=invoicedetailtbl.stocktbl JOIN invoicetbl ON >> >> >> invoicedetailtbl.fk_invoicesyscode=invoicetbl.invoiceserialno >> >> >> WHERE invoicedate=(SELECT MAX(invoicedate) FROM invoicetbl I WHERE >> >> >> I.invoiceserialno=invoicedetailtbl.fk_invoicesyscode) >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> "Nassa" <nassim.czdashti@gmail.com> wrote in message >> >> >> news:1167635476.524282.243750@k21g2000cwa.googlegroups.com... >> >> >> > Hi Everyone, >> >> >> > >> >> >> > I have 3 tables >> >> >> > -stocktbl(GSC,title,code),PK:GSC >> >> >> > -invoicedetailtbl(GSC,Comment,quantity,fee,fk_invoicesyscode,Syscode),PK:Syscode,FK:fk_invoicesyscode >> >> >> > -invoicetbl(customername,comment,invoiceserialno,invoicedate),PK:invoiceserialno >> >> >> > >> >> >> > I want to find a query of the last date and fee of objects which >> >> >> > is >> >> >> > stored in the stocktbl. >> >> >> > >> >> >> > Thanks, >> >> >> > Nassa >> >> >> > >> >> > >> > >
I'm really sorry, I have no time right now [quoted text, click to view] "Nassa" <nassim.czdashti@gmail.com> wrote in message news:1167647822.466058.210080@42g2000cwt.googlegroups.com... > Uri Dimant, > > sorry,can u fill it urself? > > Thanks, > Nassa > > > Uri Dimant wrote: >> What's about posting sample data? >> >> >> >> >> "Nassa" <nassim.czdashti@gmail.com> wrote in message >> news:1167646933.500920.151720@n51g2000cwc.googlegroups.com... >> > Uri Dimant, >> > >> > I send it to your e-mail. >> > >> > Thanks, >> > Nassa >> > >> > Uri Dimant wrote: >> >> Nassa >> >> >> >> Please post DDL >> >> >> >> CREATE TABLE blblbla (column INT......) >> >> INSERT INTO blbalbla VALUES (1212121) >> >> ...... >> >> ....... >> >> >> >> >> >> >> >> >> >> >> >> "Nassa" <nassim.czdashti@gmail.com> wrote in message >> >> news:1167642941.405036.24140@42g2000cwt.googlegroups.com... >> >> > Uri Dimant, >> >> > >> >> > I checked that before but it gives me the wrong result. >> >> > for your information: >> >> > for example,if I have 4 invoices with the bellow details: >> >> > In the invoice1on invoicedate 2006.8.25,goodsyscodes 1,2,3,4,5 have >> >> > fees 100,100,100,100,100,respectively. >> >> > In the invoice2 on invoicedate 2006.8.28,goodsyscodes 1,3,4,5 have >> >> > fees 200,200,200,200,respectively. >> >> > In the invoice3 on invoicedate 2006.8.30,goodsyscodes 2,4,3 have >> >> > fees >> >> > 300,300,300,respectively. >> >> > In the invoice4 on invoicedate 2006.8.28,goodsyscodes 1 have fees >> >> > 150. >> >> > >> >> > The results that I want: >> >> > >> >> > GoodSysCode LDate LFee >> >> > 1 2006.8.28 200 >> >> > 2 2006.8.30 300 >> >> > 3 2006.8.30 300 >> >> > 4 2006.8.30 300 >> >> > 5 2006.8.28 200 >> >> > >> >> > >> >> > Thanks, >> >> > Nassa >> >> > >> >> > >> >> > Uri Dimant wrote: >> >> >> Nassa >> >> >> Try this >> >> >> >> >> >> The relationships bet. tables are: >> >> >> dbo.InvoiceTbl LEFT OUTER JOIN >> >> >> dbo.invoiceDetailTbl ON >> >> >> dbo.InvoiceTbl.InvoiceSerialNo = >> >> >> dbo.invoiceDetailTbl.FK_InvoiceSysCode >> >> >> RIGHT OUTER JOIN >> >> >> dbo.StockTbl ON >> >> >> dbo.invoiceDetailTbl.GoodSysCode >> >> >> = dbo.StockTbl.GoodSyscode >> >> >> >> >> >> WHERE invoicedate=(SELECT MAX(invoicedate) FROM invoicetbl I WHERE >> >> >> I.invoiceserialno=invoicedetailtbl.fk_invoicesyscode) >> >> >> >> >> >> >> >> >> If it does not help, please post DDL+ sample data + an expected >> >> >> result >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> "Nassa" <nassim.czdashti@gmail.com> wrote in message >> >> >> news:1167640029.879398.74650@i12g2000cwa.googlegroups.com... >> >> >> > Uri Dimant, >> >> >> > >> >> >> > The relationships bet. tables are: >> >> >> > dbo.InvoiceTbl LEFT OUTER JOIN >> >> >> > dbo.invoiceDetailTbl ON >> >> >> > dbo.InvoiceTbl.InvoiceSerialNo = >> >> >> > dbo.invoiceDetailTbl.FK_InvoiceSysCode >> >> >> > RIGHT OUTER JOIN >> >> >> > dbo.StockTbl ON >> >> >> > dbo.invoiceDetailTbl.GoodSysCode >> >> >> > = dbo.StockTbl.GoodSyscode >> >> >> > >> >> >> > Thanks, >> >> >> > Nassa >> >> >> > >> >> >> > >> >> >> > >> >> >> > >> >> >> > Uri Dimant wrote: >> >> >> >> Nassa >> >> >> >> Untested >> >> >> >> >> >> >> >> SELECT stocktbl.GSC,title,code FROM stocktbl JOIN >> >> >> >> invoicedetailtbl >> >> >> >> ON >> >> >> >> stocktbl.GSC=invoicedetailtbl.stocktbl JOIN invoicetbl ON >> >> >> >> invoicedetailtbl.fk_invoicesyscode=invoicetbl.invoiceserialno >> >> >> >> WHERE invoicedate=(SELECT MAX(invoicedate) FROM invoicetbl I >> >> >> >> WHERE >> >> >> >> I.invoiceserialno=invoicedetailtbl.fk_invoicesyscode) >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> "Nassa" <nassim.czdashti@gmail.com> wrote in message >> >> >> >> news:1167635476.524282.243750@k21g2000cwa.googlegroups.com... >> >> >> >> > Hi Everyone, >> >> >> >> > >> >> >> >> > I have 3 tables >> >> >> >> > -stocktbl(GSC,title,code),PK:GSC >> >> >> >> > -invoicedetailtbl(GSC,Comment,quantity,fee,fk_invoicesyscode,Syscode),PK:Syscode,FK:fk_invoicesyscode >> >> >> >> > -invoicetbl(customername,comment,invoiceserialno,invoicedate),PK:invoiceserialno >> >> >> >> > >> >> >> >> > I want to find a query of the last date and fee of objects >> >> >> >> > which >> >> >> >> > is >> >> >> >> > stored in the stocktbl. >> >> >> >> > >> >> >> >> > Thanks, >> >> >> >> > Nassa >> >> >> >> > >> >> >> > >> >> > >> > >
Uri dimant, Thank you so much.here is sample data. INSERT INTO [hesab].[dbo].[invoiceDetailTbl] ([GoodSysCode] ,[Comment] ,[Quantity] ,[Fee] ,[Unit] ,[UnitRate] ,[UserPrice] ,[SerialNo] ,[Size] ,[Color] ,[WareHouse] ,[FK_InvoiceSysCode] ,[DiscountPercent] ,[Term] ,[RowNo]) VALUES (<GoodSysCode, int,> ,<Comment, nvarchar(300),> ,<Quantity, float,> ,<Fee, money,> ,<Unit, nvarchar(100),> ,<UnitRate, float,> ,<UserPrice, money,> ,<SerialNo, nvarchar(100),> ,<Size, int,> ,<Color, int,> ,<WareHouse, int,> ,<FK_InvoiceSysCode, int,> ,<DiscountPercent, float,> ,<Term, nvarchar(1000),> ,<RowNo, int,>) ------------------------------------------------------------------------------------ INSERT INTO [hesab].[dbo].[InvoiceTbl] ([CustomerName] ,[FK_AccountSysCode] ,[Comment] ,[RecivedDate] ,[DelivaredDate] ,[PaymentDate] ,[InvoiceDate] ,[FK_DocsysCode] ,[ArchiveName] ,[UserNo] ,[InvoiceNo] ,[VisitorSyscode] ,[VisitorPer] ,[VisitorAmount] ,[SysDate] ,[Sign] ,[Type] ,[Amani]) VALUES (<CustomerName, nvarchar(300),> ,<FK_AccountSysCode, int,> ,<Comment, nvarchar(300),> ,<RecivedDate, char(8),> ,<DelivaredDate, char(8),> ,<PaymentDate, char(8),> ,<InvoiceDate, char(8),> ,<FK_DocsysCode, int,> ,<ArchiveName, nvarchar(100),> ,<UserNo, int,> ,<InvoiceNo, int,> ,<VisitorSyscode, int,> ,<VisitorPer, real(24,0),> ,<VisitorAmount, money,> ,<SysDate, datetime,> ,<Sign, int,> ,<Type, int,> ,<Amani, bit,>) ------------------------------------------------------------------------------------ INSERT INTO [hesab].[dbo].[StockTbl] ([Title] ,[Code] ,[BarCode] ,[Type] ,[FstUnit] ,[SecUnit] ,[UnitRate] ,[OrderPoint] ,[SalePrice1] ,[SalePrice2] ,[SalePrice3] ,[SalePrice4] ,[SalePrice5] ,[VisitorPer] ,[Comment] ,[DiscontPer] ,[UserPrice] ,[GroupID1] ,[GroupID2] ,[SerialNo] ,[Weight] ,[Term]) VALUES (<Title, nvarchar(1000),> ,<Code, nvarchar(100),> ,<BarCode, nvarchar(100),> ,<Type, int,> ,<FstUnit, nvarchar(100),> ,<SecUnit, nvarchar(100),> ,<UnitRate, float,> ,<OrderPoint, real(24,0),> ,<SalePrice1, money,> ,<SalePrice2, money,> ,<SalePrice3, money,> ,<SalePrice4, money,> ,<SalePrice5, money,> ,<VisitorPer, float,> ,<Comment, nvarchar(300),> ,<DiscontPer, float,> ,<UserPrice, money,> ,<GroupID1, int,> ,<GroupID2, int,> ,<SerialNo, bit,> ,<Weight, real(24,0),> ,<Term, nvarchar(1000),>) does it help u? please help me,I really need it. Thanks. Nassa [quoted text, click to view] Uri Dimant wrote: > I'm really sorry, I have no time right now > > > > "Nassa" <nassim.czdashti@gmail.com> wrote in message > news:1167647822.466058.210080@42g2000cwt.googlegroups.com... > > Uri Dimant, > > > > sorry,can u fill it urself? > > > > Thanks, > > Nassa > > > > > > Uri Dimant wrote: > >> What's about posting sample data? > >> > >> > >> > >> > >> "Nassa" <nassim.czdashti@gmail.com> wrote in message > >> news:1167646933.500920.151720@n51g2000cwc.googlegroups.com... > >> > Uri Dimant, > >> > > >> > I send it to your e-mail. > >> > > >> > Thanks, > >> > Nassa > >> > > >> > Uri Dimant wrote: > >> >> Nassa > >> >> > >> >> Please post DDL > >> >> > >> >> CREATE TABLE blblbla (column INT......) > >> >> INSERT INTO blbalbla VALUES (1212121) > >> >> ...... > >> >> ....... > >> >> > >> >> > >> >> > >> >> > >> >> > >> >> "Nassa" <nassim.czdashti@gmail.com> wrote in message > >> >> news:1167642941.405036.24140@42g2000cwt.googlegroups.com... > >> >> > Uri Dimant, > >> >> > > >> >> > I checked that before but it gives me the wrong result. > >> >> > for your information: > >> >> > for example,if I have 4 invoices with the bellow details: > >> >> > In the invoice1on invoicedate 2006.8.25,goodsyscodes 1,2,3,4,5 have > >> >> > fees 100,100,100,100,100,respectively. > >> >> > In the invoice2 on invoicedate 2006.8.28,goodsyscodes 1,3,4,5 have > >> >> > fees 200,200,200,200,respectively. > >> >> > In the invoice3 on invoicedate 2006.8.30,goodsyscodes 2,4,3 have > >> >> > fees > >> >> > 300,300,300,respectively. > >> >> > In the invoice4 on invoicedate 2006.8.28,goodsyscodes 1 have fees > >> >> > 150. > >> >> > > >> >> > The results that I want: > >> >> > > >> >> > GoodSysCode LDate LFee > >> >> > 1 2006.8.28 200 > >> >> > 2 2006.8.30 300 > >> >> > 3 2006.8.30 300 > >> >> > 4 2006.8.30 300 > >> >> > 5 2006.8.28 200 > >> >> > > >> >> > > >> >> > Thanks, > >> >> > Nassa > >> >> > > >> >> > > >> >> > Uri Dimant wrote: > >> >> >> Nassa > >> >> >> Try this > >> >> >> > >> >> >> The relationships bet. tables are: > >> >> >> dbo.InvoiceTbl LEFT OUTER JOIN > >> >> >> dbo.invoiceDetailTbl ON > >> >> >> dbo.InvoiceTbl.InvoiceSerialNo = > >> >> >> dbo.invoiceDetailTbl.FK_InvoiceSysCode > >> >> >> RIGHT OUTER JOIN > >> >> >> dbo.StockTbl ON > >> >> >> dbo.invoiceDetailTbl.GoodSysCode > >> >> >> = dbo.StockTbl.GoodSyscode > >> >> >> > >> >> >> WHERE invoicedate=(SELECT MAX(invoicedate) FROM invoicetbl I WHERE > >> >> >> I.invoiceserialno=invoicedetailtbl.fk_invoicesyscode) > >> >> >> > >> >> >> > >> >> >> If it does not help, please post DDL+ sample data + an expected > >> >> >> result > >> >> >> > >> >> >> > >> >> >> > >> >> >> > >> >> >> > >> >> >> "Nassa" <nassim.czdashti@gmail.com> wrote in message > >> >> >> news:1167640029.879398.74650@i12g2000cwa.googlegroups.com... > >> >> >> > Uri Dimant, > >> >> >> > > >> >> >> > The relationships bet. tables are: > >> >> >> > dbo.InvoiceTbl LEFT OUTER JOIN > >> >> >> > dbo.invoiceDetailTbl ON
Uri Dimant, do you get it? I really need it now also I found a solution but its query cost is 64% and its too high. Thanks, Nassa [quoted text, click to view] Nassa wrote: > Uri dimant, > > Thank you so much.here is sample data. > INSERT INTO [hesab].[dbo].[invoiceDetailTbl] > ([GoodSysCode] > ,[Comment] > ,[Quantity] > ,[Fee] > ,[Unit] > ,[UnitRate] > ,[UserPrice] > ,[SerialNo] > ,[Size] > ,[Color] > ,[WareHouse] > ,[FK_InvoiceSysCode] > ,[DiscountPercent] > ,[Term] > ,[RowNo]) > VALUES > (<GoodSysCode, int,> > ,<Comment, nvarchar(300),> > ,<Quantity, float,> > ,<Fee, money,> > ,<Unit, nvarchar(100),> > ,<UnitRate, float,> > ,<UserPrice, money,> > ,<SerialNo, nvarchar(100),> > ,<Size, int,> > ,<Color, int,> > ,<WareHouse, int,> > ,<FK_InvoiceSysCode, int,> > ,<DiscountPercent, float,> > ,<Term, nvarchar(1000),> > ,<RowNo, int,>) > ------------------------------------------------------------------------------------ > INSERT INTO [hesab].[dbo].[InvoiceTbl] > ([CustomerName] > ,[FK_AccountSysCode] > ,[Comment] > ,[RecivedDate] > ,[DelivaredDate] > ,[PaymentDate] > ,[InvoiceDate] > ,[FK_DocsysCode] > ,[ArchiveName] > ,[UserNo] > ,[InvoiceNo] > ,[VisitorSyscode] > ,[VisitorPer] > ,[VisitorAmount] > ,[SysDate] > ,[Sign] > ,[Type] > ,[Amani]) > VALUES > (<CustomerName, nvarchar(300),> > ,<FK_AccountSysCode, int,> > ,<Comment, nvarchar(300),> > ,<RecivedDate, char(8),> > ,<DelivaredDate, char(8),> > ,<PaymentDate, char(8),> > ,<InvoiceDate, char(8),> > ,<FK_DocsysCode, int,> > ,<ArchiveName, nvarchar(100),> > ,<UserNo, int,> > ,<InvoiceNo, int,> > ,<VisitorSyscode, int,> > ,<VisitorPer, real(24,0),> > ,<VisitorAmount, money,> > ,<SysDate, datetime,> > ,<Sign, int,> > ,<Type, int,> > ,<Amani, bit,>) > ------------------------------------------------------------------------------------ > INSERT INTO [hesab].[dbo].[StockTbl] > ([Title] > ,[Code] > ,[BarCode] > ,[Type] > ,[FstUnit] > ,[SecUnit] > ,[UnitRate] > ,[OrderPoint] > ,[SalePrice1] > ,[SalePrice2] > ,[SalePrice3] > ,[SalePrice4] > ,[SalePrice5] > ,[VisitorPer] > ,[Comment] > ,[DiscontPer] > ,[UserPrice] > ,[GroupID1] > ,[GroupID2] > ,[SerialNo] > ,[Weight] > ,[Term]) > VALUES > (<Title, nvarchar(1000),> > ,<Code, nvarchar(100),> > ,<BarCode, nvarchar(100),> > ,<Type, int,> > ,<FstUnit, nvarchar(100),> > ,<SecUnit, nvarchar(100),> > ,<UnitRate, float,> > ,<OrderPoint, real(24,0),> > ,<SalePrice1, money,> > ,<SalePrice2, money,> > ,<SalePrice3, money,> > ,<SalePrice4, money,> > ,<SalePrice5, money,> > ,<VisitorPer, float,> > ,<Comment, nvarchar(300),> > ,<DiscontPer, float,> > ,<UserPrice, money,> > ,<GroupID1, int,> > ,<GroupID2, int,> > ,<SerialNo, bit,> > ,<Weight, real(24,0),> > ,<Term, nvarchar(1000),>) > > does it help u? > please help me,I really need it. > > Thanks. > Nassa > > Uri Dimant wrote: > > I'm really sorry, I have no time right now > > > > > > > > "Nassa" <nassim.czdashti@gmail.com> wrote in message > > news:1167647822.466058.210080@42g2000cwt.googlegroups.com... > > > Uri Dimant, > > > > > > sorry,can u fill it urself? > > > > > > Thanks, > > > Nassa > > > > > > > > > Uri Dimant wrote: > > >> What's about posting sample data? > > >> > > >> > > >> > > >> > > >> "Nassa" <nassim.czdashti@gmail.com> wrote in message > > >> news:1167646933.500920.151720@n51g2000cwc.googlegroups.com... > > >> > Uri Dimant, > > >> > > > >> > I send it to your e-mail. > > >> > > > >> > Thanks, > > >> > Nassa > > >> > > > >> > Uri Dimant wrote: > > >> >> Nassa > > >> >> > > >> >> Please post DDL > > >> >> > > >> >> CREATE TABLE blblbla (column INT......) > > >> >> INSERT INTO blbalbla VALUES (1212121) > > >> >> ...... > > >> >> ....... > > >> >> > > >> >> > > >> >> > > >> >> > > >> >> > > >> >> "Nassa" <nassim.czdashti@gmail.com> wrote in message > > >> >> news:1167642941.405036.24140@42g2000cwt.googlegroups.com... > > >> >> > Uri Dimant, > > >> >> > > > >> >> > I checked that before but it gives me the wrong result. > > >> >> > for your information: > > >> >> > for example,if I have 4 invoices with the bellow details: > > >> >> > In the invoice1on invoicedate 2006.8.25,goodsyscodes 1,2,3,4,5 have > > >> >> > fees 100,100,100,100,100,respectively. > > >> >> > In the invoice2 on invoicedate 2006.8.28,goodsyscodes 1,3,4,5 have > > >> >> > fees 200,200,200,200,respectively. > > >> >> > In the invoice3 on invoicedate 2006.8.30,goodsyscodes 2,4,3 have > > >> >> > fees > > >> >> > 300,300,300,respectively. > > >> >> > In the invoice4 on invoicedate 2006.8.28,goodsyscodes 1 have fees > > >> >> > 150. > > >> >> > > > >> >> > The results that I want: > > >> >> > > > >> >> > GoodSysCode LDate LFee > > >> >> > 1 2006.8.28 200 > > >> >> > 2 2006.8.30 300 > > >> >> > 3 2006.8.30 300 > > >> >> > 4 2006.8.30 300 > > >> >> > 5 2006.8.28 200 > > >> >> > > > >> >> > > > >> >> > Thanks, > > >> >> > Nassa > > >> >> > > > >> >> > > > >> >> > Uri Dimant wrote: > > >> >> >> Nassa > > >> >> >> Try this > > >> >> >> > > >> >> >> The relationships bet. tables are: > > >> >> >> dbo.InvoiceTbl LEFT OUTER JOIN > > >> >> >> dbo.invoiceDetailTbl ON > > >> >> >> dbo.InvoiceTbl.InvoiceSerialNo = > > >> >> >> dbo.invoiceDetailTbl.FK_InvoiceSysCode > > >> >> >> RIGHT OUTER JOIN > > >> >> >> dbo.StockTbl ON > > >> >> >> dbo.invoiceDetailTbl.GoodSysCode > > >> >> >> = dbo.StockTbl.GoodSyscode > > >> >> >> > > >> >> >> WHERE invoicedate=(SELECT MAX(invoicedate) FROM invoicetbl I WHERE
Hugo Kornelis, Thank you for your info. I found the results. Have fun, Thanks, Nassa [quoted text, click to view] Hugo Kornelis wrote: > On 1 Jan 2007 20:58:11 -0800, Nassa wrote: > > >Uri dimant, > > > >Thank you so much.here is sample data. > (snip) > >does it help u? > >please help me,I really need it. > > Hi Nassa, > > Probably not, because there's no real data there. I couldn't run your > script because you have sent the table DDL to Uri's mail, but even with > the CREATE TABLE statements, I'd just get errors for running the INSERT > statemtents you posted. > > If you want help, youu reallly have to post the following to the > newsgroup: > > * CREATE TABLE statements for all tables involved. You may omit columns > that are irrelevant for the problem, but do include all constraints, > properties, and indexes! > > * INSERT statements with sample data that illustrates the problem. Make > sure to use locale-independant format for dates (yyyymmdd). > > * Expected results. > > Also, create a new, empty database on your own server, run the CREATE > TABLE and INSERT statements, and correct any errors before posting them. > > If you need more help assembling the information for your next post, > please consult www.aspfaq.com/5006. > > -- > Hugo Kornelis, SQL Server MVP > My SQL Server blog: http://sqlblog.com/blogs/hugo_kornelis
[quoted text, click to view] On 1 Jan 2007 20:58:11 -0800, Nassa wrote: >Uri dimant, > >Thank you so much.here is sample data. (snip) >does it help u? >please help me,I really need it.
Hi Nassa, Probably not, because there's no real data there. I couldn't run your script because you have sent the table DDL to Uri's mail, but even with the CREATE TABLE statements, I'd just get errors for running the INSERT statemtents you posted. If you want help, youu reallly have to post the following to the newsgroup: * CREATE TABLE statements for all tables involved. You may omit columns that are irrelevant for the problem, but do include all constraints, properties, and indexes! * INSERT statements with sample data that illustrates the problem. Make sure to use locale-independant format for dates (yyyymmdd). * Expected results. Also, create a new, empty database on your own server, run the CREATE TABLE and INSERT statements, and correct any errors before posting them. If you need more help assembling the information for your next post, please consult www.aspfaq.com/5006. -- Hugo Kornelis, SQL Server MVP
Don't see what you're looking for? Try a search.
|