Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Help me with SQL
Message
 
 
À
03/08/2001 01:21:54
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00538338
Message ID:
00539318
Vues:
9
There is no problem with sql staement. It works as it suppose to work. Based on incomplete information you provided I can only guess what you have and what you want. Following select statement will combine the records from two tables into one and order them by Itemcode and date. You'll have to adjust the number of zeros to the actual size of quantity field.
SELECT ;
      Inward.Itemcode,  ;
      Inward.date, ;
      Inward.Qantity AS Inward, ;
      000000 AS Outward ;
   FROM Inward ;
UNION ALL ;
SELECT ;
      Outward.Itemcode, , ;
      Outward.date, ;
      000000  AS Inward, ;
      Outward.Qantity AS Outward ;
   FROM Outward ;
   ORDER BY 1, 2
>There seems some problem with the sql statement. The number of records is reccount(inward) * reccount(outward).
>While there should be at most 365 days entry for one year stock book.
>Each record in outward is repeated inward number or times.
>
>Rajesh
>SELECT ;
> IIF( ISNULL(Inward.Itemcode), Outward.Itemcode, Inward.Itemcode) AS Itmecode, ;
> IIF( ISNULL(Inward.Itemcode), Outward.date, Inward.date) AS date, ;
> NVL(Inward.Qantity, 0) AS Inward, ;
> NVL(Outward.Qantity, 0) AS Outward ;
> FROM Inward ;
> FULL OUTER JOIN Outward on Inward.Itemcode = Outward.Itemcode
>
> >I have two views
> >1. Inward register
> > fields itemcode, date, quantity
> >2. Outward register
> > fields itecode, date, quantity
> >
> >Iwant to create a third view from the above two which is of format
> >
> >Stock register
> > Fields Itemcode, Date , Inward, Outward.
> >
> >IS it possible using SQL statement of whould go in for usal programming method
> >Rajesh
--sb--
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform