Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
Pinto
Aged Yak Warrior
590 Posts |
Posted - 2005-08-16 : 04:50:54
|
| I have following SQL which passes parameters to a Crystal report.If I include this line& " ORDER BY vweChaseFilesOUT.Dept"I get the following error message'The remaining text does not appear to be part of the formula.'Ff I remove the ORDER BY line it works. Can anyone see my error ? Case 1 'By Department req.ReportState.RecordSelectionFormula = "{vweChaseFilesOut.Dept} Like '*" & strDept & "*' and" _ & " {vweChaseFilesOut.Division} like '*" & strDiv & "*' and" _ & " {vweChaseFilesOut.Sect} like '*" & strSection & "*' and" _ & " {vweChaseFilesOut.LastDateOut} in DateTime(" & SYear & "," & SMonth & "," & SDay & ", 00, 00, 00) to DateTime(" & EYear & "," & EMonth & "," & EDay & ", 00, 00, 00)" _ & " ORDER BY vweChaseFilesOUT.Dept" |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2005-08-16 : 05:01:13
|
| vweChaseFilesOUT.Dept should be within bracesIt should be {vweChaseFilesOUT.Dept}MadhivananFailing to plan is Planning to fail |
 |
|
|
Pinto
Aged Yak Warrior
590 Posts |
Posted - 2005-08-16 : 05:29:24
|
| I tried that but it made no difference..... |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2005-08-16 : 05:32:30
|
| I think you cannot do this because you are selecting records by passing valuesYou need to do this in your reportOpen the report and set the sort fieldMadhivananFailing to plan is Planning to fail |
 |
|
|
Pinto
Aged Yak Warrior
590 Posts |
Posted - 2005-08-16 : 06:11:51
|
| Yes, I think I will have to do it that way. My select though is based on the sort order so I will have to have a separate report for each different sort order. Never mind !Thanks for your help |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2005-08-16 : 06:22:13
|
| If you are using CR8 then you can use CR.SQLQuery where you can write query with Order by ClauseMadhivananFailing to plan is Planning to fail |
 |
|
|
Pinto
Aged Yak Warrior
590 Posts |
Posted - 2005-08-16 : 11:46:08
|
| I am using CR9. I am a beginner though as you can guess so am not sure how to do what you suggest. |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2005-08-17 : 02:34:19
|
| In your Front End Application, you can declare Dim CrRpt As CRAXDRT.Report..CrRpt.SQLQueryString="your query with order by"MadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|
|
|