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

Secondary Grouping help needed

Status
Not open for further replies.

Tech2377

Programmer
Nov 13, 2007
81
0
0
In my SQL query, I have a field named 'pv.visit'. It pulls a patients visit date and displays in this manner:

'2007-10-26 14:54:00.000'

I took this and added in another field that displayed this date as 'October 2007'. This was named [VisitDate](sql code below):

SQL Code
Code:
DateName(Month, pv.visit) + ' ' + Convert(VarChar(4), Year(pv.visit)) AS VisitDate,

In Crystal I want to group primary on Doctor Name and then Group all the Visits in a month together and name that Group Header with the naming convention I did in SQL.

In my report, I made two Groups. In my first grouping, I group off the Doctors Name. In the second grouping, I did grouping off pv.visit, however that gave me a grouping off each date of service. This was understandable and I know it was wrong. I think I need some help trying to figure out how to group up a months worth of visits and display that.

 
If you create a formula like {@datetime}:

cdatetime(left({pv.visit}, instr({pv.visit},".")-1))

...it will become a datetime and you can insert a group on it and choose "print for each month."

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top