Results 1 to 2 of 2

Thread: Reports

  1. #1
    Join Date
    Dec 1969

    Default Reports

    We are trying to create reports from a sql database - we have discovered that we can but a html table into an excel sheet which is no problem, the problem is when creating the html table.<BR><BR>These reports are attendance information<BR><BR>The company would like to see by date across the top and the names down the first column and then the attendance corresponding to the person and the date entered in the correct column. Our problem is getting the attendance in the correct column. <BR><BR>The date is received by the user in text boxes a date from and a date to and the names come from the employee list of a particular group stored in the database: <BR><BR>The report they want to see: <BR><BR>Customer Service <BR><BR><BR>Name Jan 1, 2001 Jan 2, 2001 Jan3, 2001 etc.<BR>Tammy 1 1<BR>Ashley 1 <BR>George 1 1 1<BR>Bob 1<BR><BR><BR>and this is what we can give them: <BR><BR><BR>Tammy Jan 1, 2001 1<BR>Tammy Jan 2, 2001 1 <BR>Ashley Jan 2, 2001 1<BR>George Jan 1, 2001 1 <BR>George Jan 2, 2001 1<BR>George Jan 3, 2001 1 <BR>Bob Jan1, 2001 1<BR><BR>If you have any answers it would be great!<BR>

  2. #2
    Join Date
    Dec 1969

    Default Attendance, huh?

    So it&#039;s good old homework time, is it?<BR><BR>Let&#039;s face it, the only place where Attendance would be 1 would be in school. At work, it&#039;s 8 or some bigger number. Or the person isn&#039;t employed long.<BR><BR>And since this is really a pretty simple problem, I don&#039;t think I believe the bit about a "company" needing this and "we can give them...". I think this is homework and *you* can&#039;t figure it out.<BR><BR>Which is okay, if I&#039;m right, but next time be more honest, if this is indeed the case.<BR><BR>Anyway...<BR><BR>Okay, so the part that "we can give them" is basically a raw dump of the data in the database for the period specified, isn&#039;t it? You haven&#039;t even attempted to munge the data here.<BR><BR>So what "trick" is involved?<BR><BR>What you need to do is (in pseudo code):<BR><BR>(1) Pick next record, quitting if there are no more<BR>(2) If this is a new person, finish off the prior row (if needed) and start a new one<BR>(3) Starting on "current day" being the first day of period specified...<BR>(4) Does the "current day" match the date in the current record?<BR>(5) If answer to (4) is no, <BR>(5A) Put a zero (or nothing) into the current cell of the output<BR>(5B) Move "current day" to next day<BR>(5C) Loop back to (4)<BR>(6) If answer to (4) is yes,<BR>(6A) Put a 1 (or the actual hours?) into the current cell of the output<BR>(6B) Loop back to (1)!<BR><BR>Now, can you convert that to code? You posted in the "Advanced" section, so it would seem so. But, if not, give it a shot and then show us what you&#039;ve done.<BR><BR>

Posting Permissions

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