Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Sql commnand
Message
De
19/04/2006 09:15:20
Jim Winter
Jim Winter Consulting
Hinesburg, Vermont, États-Unis
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
01114555
Message ID:
01114559
Vues:
21
This message has been marked as a message which has helped to the initial question of the thread.
>hi all,
>I need to select out some data from a table but i am having a problem getting the syntax correct, i don't know if what i am trying to do is possible in one statement. I have a table that has data including depots and on site locations where work will be done. What i need to do is select out from the table where a date field is equal to a form property and then group by depot and then by day within depot and finally sort by time within day
>in pseudocode something like,
>
>sele * ;
>    from table 1 ;
>    where week(dateofwork) = thisform.currweekno ;
>    group by depot, subgroup by CDOW(dateofwork) ;
>    order by depot, suborder by time under day
>
>
>I need the final table to look something like
>
>DEPOT     SUN          MON            TUE          WED...
>__________________________________________________________________
>DUBLIN    9  Finglas   9.30 CITY      10 Dublin7   9.30  Dublin8
>DUBLIN    11 CITY      12   Skerries  11 Bray      10.30 Wicklow
>
>CORK      9  Cobh      10.30 Cobh     8  Kerry     11.30 Town
>CORK      10 TOWN      12    Yaughal  10 City      13    Clonakilty
>
>Slán
>~M
SELECT Depot, DateOfWork, CDOW(DateOfWork) as Day, Time ;
  FROM Table1 ;
 WHERE WEEK(DateOfWork) = ThisForm.txtCurrWeekNo.Value ;
 ORDER BY Depot, DateOfWork, Time ;
  INTO CURSOR WorkSched
This will get your data into the order you want but it won't look the way you have it above.

HTH,
Jim
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform