Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
kaus
Posting Yak Master
179 Posts |
Posted - 2004-04-20 : 17:43:33
|
I want to group my data by month-year I've got the following query:SELECT Sites.SiteNo, Avg( [Monthly_BOD/TSS].BOD_mgl) as BOD_AVG, Avg([Monthly_BOD/TSS].TSS_mgl) as TSS_AVG, MonthName([Monthly_BOD/TSS].Sample_Date) & "-" & cast(Year([Monthly_BOD/TSS].Sample_Date) , text) as yrFROM Sites Inner JOIN [Monthly_BOD/TSS] ON Sites.SiteNo = [Monthly_BOD/TSS].SiteNoGroup by Sites.SiteNo,MonthName([Monthly_BOD/TSS].Sample_Date) & "-" & cast(Year([Monthly_BOD/TSS].Sample_Date) , text) as yrsample date values are like jan-25-2003I'm getting missing operator error in query expression -- I'm thinking the Year() function returns an integer and I need to convert to string -- ThanksPete |
|
kaus
Posting Yak Master
179 Posts |
Posted - 2004-04-20 : 18:00:56
|
Nevermind -- I got it Format([Monthly_BOD/TSS].Sample_Date, "mmm yyyy") |
 |
|
mohdowais
Sheikh of Yak Knowledge
1456 Posts |
Posted - 2004-04-21 : 01:44:40
|
Just FYI, to cast a value to string in Access, you can use the CStr() function.OS |
 |
|
|
|
|