Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL Select help
Message
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Miscellaneous
Thread ID:
00153136
Message ID:
00153165
Views:
21
> emp_id C(4)
> emp_name C(30)
> date D
> in_time T
> out_time T
> lateness C(4)
> overtime C(4)

Hi Virusim,
This will get you close to the desired output example you gave us in your first post...
SELECT emp_id, DTOC(time_in) as TheDate, MIN(TTOC(time_in,2)), ;
   MAX(TTOC(time_out,2)), latness, overtime ;
   FROM TableName GROUP BY empid
One problem I see is that in the desired output you posted, you seem to be showing that Latness should come from the MIN(time_in) record and Overtime should come from the MAX(time_out) record. If this is correct then we need to do this with two queries and a UNION. The SELECT I give you above is going to carry the Latness and Overtime fields from the last record found in the Group By.
Roxanne M. Seibert
Independent Consultant, VFP MCP

Code Monkey Like Fritos
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform