splitting records based on date(s) (long)

Results 1 to 2 of 2

Thread: splitting records based on date(s) (long)

  1. #1
    genic Guest

    Default splitting records based on date(s) (long)

    first of all, thank you bill for your answers yesterday. they worked perfect. here is a more indepth question though. first i will tell you what i am doing as of right now. then what i need to be doing. <BR>i am selecting all hours based upon which project is choosen. i am grouping the profileemails together and summing their hours to get a total for each distinct profileemail. right now this happens for all records. this the query that does this is:<BR><BR>select a.profileemail, c.profile_team, sum(convert(decimal(10,4), a.hours)) as hourSum <BR>from projecttime as a <BR>inner join profile as b on (b.profileemail = a.profileemail) <BR>inner join profileteam as c on (b.profile_team = c.profile_team_id) <BR>where ...<BR>group by a.profileemail, c.profile_team<BR>order by a.profileemail <BR><BR>this works great. here is where it gets tricky.<BR>they want to be able to search upon a date range. ie: 2/1/01 - 2/10/01 and retrieve all records within this range. no problem there..i can already do that. here is the problem. each day has to be separated and have the total for THAT day for each distinct profileemail. then go to the next day. and so on. at the same time, i have to take the totals of each day for each profileemail email and have the total. here is an example of how it would look<BR>(- for spacers)<BR>profileemail---team--day1--day2--day3--totals<BR>erik@bla.com---team--1.5---3-----4-----8.5<BR>erik2@bla.com--team--3-----4-----5-----12<BR>erik3@bla.com--team--1-----2-----2.5---5.5<BR>--------------totals-5.5---9-----11.5--52<BR><BR>do you see how i am adding each row and then each colum? right now i can add the colum just fine when NO date range is given. i have NO clue how to split into different days and then total up each ROW and then total up each colum...and then add those TWO together. please help!

  2. #2
    genic Guest

    Default this might help in answering this

    i am throwing the records into an array<BR><BR>uArray = objConn.Execute(sSqlProject_users).getrows

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts