Grouping by Year

wgma

Registered User.
Local time
Today, 02:14
Joined
Nov 19, 2007
Messages
72
I have a query that I need to group by the year of a date that is stored as a string , i.e. 20080630.

SELECT WGMAHIST_TIMEDTY.TDYLCL, WGMAHIST_TIMEDTY.TDYTDT, sum(WGMAHIST_TIMEDTY.TDYFND) AS Hrs
FROM WGMAHIST_TIMEDTY
WHERE WGMAHIST_TIMEDTY.TDYSSN=123456789
group by WGMAHIST_TIMEDTY.TDYTDT, WGMAHIST_TIMEDTY.TDYLCL

I know that this can be done but How?

Thanks
 
Try

Left(FieldName, 4)
 
I did that and it threw an error.
 
What was the error? Exactly how did you use it? What's the full SQL now?
 

Users who are viewing this thread

Back
Top Bottom