haibec Posted August 20, 2006 Share Posted August 20, 2006 Hi Guys!I have a table User includes : ID, Level, Lastlogout . I want create a function have mission : Scan all user from level 1 to level N already logout in space time : Example : from 08/18/2006 to 08/20/2006 . Please help me! Link to comment Share on other sites More sharing options...
Reg Edit Posted August 21, 2006 Share Posted August 21, 2006 Well, if this is MS SQL Server you can say something like: SELECT * FROM User WHERE (Level BETWEEN 1 AND n) AND (Lastlogout BETWEEN '18 Aug 2006' AND '20 Aug 2006') Link to comment Share on other sites More sharing options...
haibec Posted August 23, 2006 Author Share Posted August 23, 2006 Well, if this is MS SQL Server you can say something like:SELECT * FROM User WHERE (Level BETWEEN 1 AND n) AND (Lastlogout BETWEEN '18 Aug 2006' AND '20 Aug 2006') Okie thanhk you! But my problem is : With each level i want scan how many logout in that space time! Link to comment Share on other sites More sharing options...
Reg Edit Posted August 23, 2006 Share Posted August 23, 2006 Okie thanhk you! But my problem is : With each level i want scan how many logout in that space time!Well, still assuming this is MS SQL Server or Access, and depending on what you want to do with the result, you can say something like (Access syntax this time):SELECT [Level], COUNT(*) AS NumUsersAtLevel FROM User WHERE ([Level] BETWEEN 1 AND n) AND (Lastlogout BETWEEN #18 Aug 2006# AND #20 Aug 2006#)GROUP BY [Level]ORDER BY [Level] Link to comment Share on other sites More sharing options...
haibec Posted August 25, 2006 Author Share Posted August 25, 2006 Well, still assuming this is MS SQL Server or Access, and depending on what you want to do with the result, you can say something like (Access syntax this time):SELECT [Level], COUNT(*) AS NumUsersAtLevel FROM User WHERE ([Level] BETWEEN 1 AND n) AND (Lastlogout BETWEEN #18 Aug 2006# AND #20 Aug 2006#)GROUP BY [Level]ORDER BY [Level] Oh! Very well!Thank o lot! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now