| |||||||
| Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics. |
![]() |
| | LinkBack | Thread Tools |
| | #1 (permalink) |
| NamePros Member | I need a query that will select all records from 2/1/2008 through 2/28/08 along with selecting fields for todays date only (date() ) It is counting total points a user is accumulating throughout the month and displaying the total next to their name. Also "Todays Today" needs to be displayed next to their name. Is this possible? Name Month to date total Today's total xxxxx 99999 99999 Thanks in advance!! |
| |
| | #3 (permalink) |
| Senior Member | if you show us the sql you are currently using it should be possible without too much hassle. Also as monaco asks what is the database engine you are using.
__________________ Manage your portfolio using my new Domain Portfolio Management script. Securing Your Domain Name From Theft |
| |
| | #4 (permalink) |
| Traveller | a tabular report of totals for month and day for all users? i think something like: select tablea.userid, tablea.username, thismonth.monthtotal, thisday.daytotal from table tablea inner join ( select sum(fieldA) as monthtotal, userid from table tableb where datefield > 2/1/2008 and datefield < 2/28/08 group by userid ) thismonth on thismonth.userid = tablea.userid inner join ( select sum(fieldA) as daytotal, userid from table tablec where datefield = CURDATE() group by userid ) thisday on thisday.userid = tablea.userid
__________________ Internet.geek.nz NameCooler.com Unlimited Domain Name Web Hosting Travel Money Rates |
| |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| |