Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CR8.5/SQL7-Negative Reporting Based On Two Diff. Tables-HOW?

Status
Not open for further replies.

Drakhan

Technical User
Jun 3, 2002
67
US
Is there anyway to the following. I have source for my data, two different tables. One table contains the Users ID, let's call this {TABLE1.USERID}, next I have Login time which I would like to report against as well {TABLE2.LOGIN}.

My goal, which is 1/2 way completed, is to create a report that shows who logged in based on a date. I can show who logged in to the application by using a select expert that is greater than or equal to {TABLE2.LOGIN} - this is in one subreport. I am using a running total to sum the amount of logons. Works great.

Here is where it gets tricky! How do I create a subreport that reports on people who did not logon? The data is in the table, however getting it out based on the two fields above has proven difficult. I have tried using less than or equal to {TABLE2.LOGIN}, however, I receive EVERYBODY who has logged in, including those that were listed in the previous subreport. What I would like to do is just show a '0' if they have not logged in during the reporting period, or who have never logged in for that matter. Can this be done? I was thinking about an array, but these are string variables. Any insight??
 
Try the following :
In a crystal report select both tables

left join the login table to the userid table (main table).
This has the following effect of keeping all the records in the userid table even if the user has no logged in data.

Then place the fields you need in the detail section.
say userid and login date.

If the user has not yet logged in. The login date will be a null value, which you can then test for.

 
Hey thanks for the reply. It worked great! Thanks!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top