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 |
|
Adreanne
Starting Member
9 Posts |
Posted - 2007-05-03 : 09:38:03
|
| how would i take the query and show just the current months unique loginsSELECT DISTINCT YEAR(Login_Time) AS Year, MONTH(Login_Time) AS Month, COUNT(*) AS Login_CntFROM LoginWHERE Login_Time >=#10/1/2005#GROUP BY YEAR(Login_Time), MONTH(Login_Time)ORDER BY YEAR(Login_Time), MONTH(Login_Time) |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2007-05-03 : 09:41:23
|
| If you have more MS Access questions, please post them in the MS Access forum.SELECT YEAR(Login_Time) AS Year, MONTH(Login_Time) AS Month, COUNT(*) AS Login_CntFROM LoginWHERE YEAR(Login_Time) = YEAR(NOW) AND MONTH(Login_Time) = MONTH(NOW)Peter LarssonHelsingborg, Sweden |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2007-05-05 : 04:20:36
|
quote: Originally posted by Peso If you have more MS Access questions, please post them in the MS Access forum.SELECT YEAR(Login_Time) AS Year, MONTH(Login_Time) AS Month, COUNT(*) AS Login_CntFROM LoginWHERE YEAR(Login_Time) = YEAR(NOW) AND MONTH(Login_Time) = MONTH(NOW)Peter LarssonHelsingborg, Sweden
You missed Group by MadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|