var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: jsp sql : Count how many Sunday in a date range
I hv a database "signdetail" which is let users sign in and sign out.
userid | login | logout
String sqlsign = "SELECT MAX(login) AS login1, DATEDIFF(day, MAX(login), getdate()) AS absentday FROM signdetail WHERE userid=?";
sql above will return the result TOTAL DAYS NOT SIGN IN btw their last sign in date and current day.
But I have to minus this absentday with how many sunday btw their last sign in date and current day.
Much appreciate if anyone can give me some idea..
Is it something like
String sqlsun = "SELECT COUNT(*) FROM (SELECT TO_DATE(MAX(login), getdate()) dt FROM signdetail) WHERE TO_CHAR(dt,'Day') = 'Sunday';"