Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Sql commnand
Message
 
To
19/04/2006 09:15:20
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
01114555
Message ID:
01119500
Views:
16
Jim, thanks for the note, got me on the right track
Slán
~M

>>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,
Go raibh maith agat

~M
Previous
Reply
Map
View

Click here to load this message in the networking platform