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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL Expression

Status
Not open for further replies.

NTSGuru

Programmer
Jul 25, 2000
52
Here is what I am trying to do : (if you have a better suggestion, I'm open to anything!)

I have a group based on a field off of MSSQL7.0 which contains data for this month's activity only. I have a count on that group to give me a cumulative total for the month (how many records of a specific type have been added since the 1st of the particular month). What I need to do is have a sub-count to let me know how many were added on the previous day.

I have tried everything. What I am trying now is to do use the SQL Expression editor to give me a "COUNT(Summary.ID) WHERE Date = myDate", but that doesn't seem to work. I guess you can't do that sort of computation in the editor.

I have tried formulas, summaries, etc. Nothing seems to work. I know that I can probably do it in a sub-report, but I really don't want to go that route for programming/logistics reasons.

I call upon the great Crystal Intelligencia out there to help me solve my plight!

TIA
Fred [sig][/sig]
 
This is akin to swatting a fly with a sledge hammer, but ...
The problem can be solved fairly easily and efficiently in SQL. Now, the easiest way to use SQL in Crystal Reports (when using MSSQL) is through stored procedures. This allows you avoid the quirks of Crystal - a fairly satisfying tradeoff, and gives much better performance.
[sig][/sig]
 
Hello,

I have a report on which I print out records based on two input parameters

1) Start Date
2) End Date

These are in table A.

I then want to calculate the day difference between Start date and end date based on whether they were work days or not but the information whether start date and end date and all the days in between are work days is in another table B. This table B stores all calendar days and has a variable called daytype coonected with each record. If daytype=WRK then it is a work day.

Please help
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top