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!

SQLQueryString ORDER BY Problem!!!

Status
Not open for further replies.

gashcud

Programmer
Sep 25, 2002
13
0
0
AT
Hi,

I'm creating a report that should be displayed on an ASP Page. I want to pass an SQL string to the report which has an ORDER BY clause. I checked the SQL string in SQL-Server Query Analyzer and it worked fine. However when I pass it to the rport's SQLQueryString property the report displayed is not ordered

What could be the problem????? PLEASE HELP!!!!

cheers
Gash
 
Is the query analyzer you tested in connecting via same connection (ODBC and other drivers the same)? Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
tek@kenhamady.com
 
Can't think of anything, off-hand.

Can you log the request in the database and see if the Order By clause is making it to the database? Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
tek@kenhamady.com
 
this is the SQL string that is passed to the DB, but how can I find out if it makes it to the db

SELECT vwKalkulationsvorschau.ANB_PROJEKT_NAME, vwKalkulationsvorschau.ANB_BBR, vwKalkulationsvorschau.ANB_ART, vwKalkulationsvorschau.ANB_EINGANG_DT, vwKalkulationsvorschau.ANB_ABGABE_ORT, vwKalkulationsvorschau.ANB_ABGABE_DT, vwKalkulationsvorschau.ANB_ABGABE_ZT, vwKalkulationsvorschau.ANB_INTERESSE, vwKalkulationsvorschau.ANB_KALKULATION_NR_INTERN, vwKalkulationsvorschau.ANB_WAEHRUNG, vwKalkulationsvorschau.ANB_INTERESSE_ARGE, vwKalkulationsvorschau.ANB_AUSSCHREIBER, vwKalkulationsvorschau.ANB_PLANER, vwKalkulationsvorschau.ANB_BAUHERR, vwKalkulationsvorschau.ANB_ORT_CODE, vwKalkulationsvorschau.KAL_KUERZEL, vwKalkulationsvorschau.BET_BEZEICHNUNG, vwKalkulationsvorschau.BBR_BEZEICHNUNG, vwKalkulationsvorschau.BBR_CC_VORSCHAU, vwKalkulationsvorschau.Kollision, vwKalkulationsvorschau.ASA_BEZEICHNUNG FROM AlpineDB.dbo.vwKalkulationsvorschau vwKalkulationsvorschau INNER JOIN zstblAnbot ON vwKalkulationsvorschau.ANB_ANB = zstblAnbot.ANB_ANB WHERE zstblAnbot.ANB_USER = 'SALTWARE\GeorgP' ORDER BY BET_BEZEICHNUNG, BBR_BEZEICHNUNG, ANB_KALKULATION_NR_INTERN
 
When I look at the SQL Server's Current Activity, I can only view the first 255 bytes of the SQL String (but the 255 bytes seem to be ok)
 
I am not a database expert, but it surprises me that you can only see part of the request. Is that a database limitation?

Also, do you have any sorting or grouping in the report? That will take priority over the Order By of the SQL. Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
tek@kenhamady.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top