Jennifer, A couple of suggestions, assuming you are workin gin 7.x:
1. Use breakpoints in the report to do the sorting for you. Proper use of breaks will eliminate the need for any ORDER BY in your print statement. 2. Use parenthesis for your WHERE clause conditions: WHERE discharge IS NULL + AND company <> '003' + AND (nexthp < .vtoday + OR nexthp BETWEEN .vtoday AND (.vtoday + 7)) The added parenthesis starting just before "nexthp" and after "(.vtoday + 7)" will cause the entire date range specification to be properly evaluated. Emmitt Dove Manager, DairyPak Business Systems Evergreen Packaging, Inc. [EMAIL PROTECTED] [EMAIL PROTECTED] (203) 643-8022 -----Original Message----- From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Roberts, Jennifer Sent: Monday, April 28, 2008 1:28 PM To: RBASE-L Mailing List Subject: [RBASE-L] - Illegal Column Specification Hello, I am trying to create a report where the data is being filtered with the following code: PRINT hpreport WHERE discharge IS NULL + AND company <> '003' + AND nexthp < .vtoday + OR nexthp BETWEEN .vtoday AND (.vtoday + 7) + ORDER BY room ASC, nexthp ASC + However the order by does not work. I get an order by room number, but then not by the nexthp which is a date field. I thought that I should put a ‘group by’ in since I need to basically group by building a floor, and then show the dates in ascending order on each building/floor. Every time I try to put a group by clause in here it gives mt the illegal column specification error. What am I doing wrong here? I’m sure I am overlooking something really simple. Thank you, Jennifer Roberts

