Author |
Topic |
PhoeNIx
Starting Member
9 Posts |
Posted - 2006-11-25 : 04:41:14
|
Hi! i'm a new member in sqlteam.i want to know the difference the working time in query statement and the working time in project.i mean when we use select statement for crystal report , should i write all field needed in query or write using report formula or parameter?which way is more fast? |
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2006-11-25 : 04:54:25
|
Be clear about the use of both tools: Crystal and SQL ServerSQL Server is best at retrieving related data in best possible manner and least amount of time whereas Crystal Reports is better at neatly presenting that data.So, I would suggest you bring all the required values in the query in raw format and then apply whatever formulas you want on them in the Crystal Report. e.g. If you have LastName and FirstName fields in the table, but in the report you want to show as FirstName + ' ' + LastName, Don't use query like this:Select FirstName + ' ' + LastName, ... from Tbl Instead bring individual fields and then write formula in Crystal to concatenate them.Harsh AthalyeIndia."Nothing is Impossible" |
 |
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-11-25 : 08:32:56
|
Can you give more details?You should select all the required columns and at the same time you need to use fromulae if requiredMadhivananFailing to plan is Planning to fail |
 |
|
PhoeNIx
Starting Member
9 Posts |
Posted - 2006-11-28 : 00:51:28
|
quote: Originally posted by harsh_athalye Be clear about the use of both tools: Crystal and SQL ServerSQL Server is best at retrieving related data in best possible manner and least amount of time whereas Crystal Reports is better at neatly presenting that data.So, I would suggest you bring all the required values in the query in raw format and then apply whatever formulas you want on them in the Crystal Report. e.g. If you have LastName and FirstName fields in the table, but in the report you want to show as FirstName + ' ' + LastName, Don't use query like this:Select FirstName + ' ' + LastName, ... from Tbl Instead bring individual fields and then write formula in Crystal to concatenate them.Harsh AthalyeIndia."Nothing is Impossible"
thanks a lot,Harsh Athalye.now i just wanna know why i shouldn't use query like this:and why i should write in formula.could you explain me more details,plz?PhoeNIx |
 |
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2006-11-28 : 01:16:44
|
I already explained that!SQL Server is not very good in terms of speed when it comes to string manipulation...So whenever there are formatting changes or string splitting or concatenation, it's good to do it in front-end. Also, it gives you more flexibility in terms of handling changes. Suppose in my example, instead of FirstName + ' ' + LastName, you want sequence to be LastName + ' ' + FirstName, you will have to change the query. Whereas, if you just bring in FirstName and LastName as separate fields and then concatenate them in Crystal using formula, you will have to just change formula. Anyway, it was just a simple example...you can get into more complex situations than this where implementing those chages at back-end level is simply unacceptable.Harsh AthalyeIndia."Nothing is Impossible" |
 |
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-11-28 : 09:06:21
|
>> why i should write in formula.It depends on what you want to do. You should use formulae, if you want to generate1 Concatenation2 Running Total3 Serial No4 Suppres Duplicate values5MadhivananFailing to plan is Planning to fail |
 |
|
jsmith8858
Dr. Cross Join
7423 Posts |
Posted - 2006-11-28 : 09:27:24
|
Simple rule of thumb: Your goal in SQL Server is to generate a concise but complete set of data for your reporting tool to process. You should filter, join, and summarize the data in SQL, and then return those raw results to your reporting tool. Then, your reporting tool can handle additional calculations, formatting, totaling, grouping, and so on.- Jeff |
 |
|
PhoeNIx
Starting Member
9 Posts |
Posted - 2006-12-02 : 05:16:40
|
quote: Originally posted by harsh_athalye I already explained that!SQL Server is not very good in terms of speed when it comes to string manipulation...So whenever there are formatting changes or string splitting or concatenation, it's good to do it in front-end. Also, it gives you more flexibility in terms of handling changes. Suppose in my example, instead of FirstName + ' ' + LastName, you want sequence to be LastName + ' ' + FirstName, you will have to change the query. Whereas, if you just bring in FirstName and LastName as separate fields and then concatenate them in Crystal using formula, you will have to just change formula.thank u so much. Anyway, it was just a simple example...you can get into more complex situations than this where implementing those chages at back-end level is simply unacceptable.Harsh AthalyeIndia."Nothing is Impossible"
|
 |
|
PhoeNIx
Starting Member
9 Posts |
Posted - 2006-12-02 : 05:17:54
|
quote: Originally posted by madhivanan >> why i should write in formula.It depends on what you want to do. You should use formulae, if you want to generate1 Concatenation2 Running Total3 Serial No4 Suppres Duplicate values5MadhivananFailing to plan is Planning to fail
thank u. |
 |
|
PhoeNIx
Starting Member
9 Posts |
Posted - 2006-12-02 : 05:19:07
|
quote: Originally posted by jsmith8858 Simple rule of thumb: Your goal in SQL Server is to generate a concise but complete set of data for your reporting tool to process. You should filter, join, and summarize the data in SQL, and then return those raw results to your reporting tool. Then, your reporting tool can handle additional calculations, formatting, totaling, grouping, and so on.- Jeff
thank u. |
 |
|
PhoeNIx
Starting Member
9 Posts |
Posted - 2006-12-02 : 05:19:59
|
quote: Originally posted by PhoeNIx
quote: Originally posted by harsh_athalye I already explained that!SQL Server is not very good in terms of speed when it comes to string manipulation...So whenever there are formatting changes or string splitting or concatenation, it's good to do it in front-end. Also, it gives you more flexibility in terms of handling changes. Suppose in my example, instead of FirstName + ' ' + LastName, you want sequence to be LastName + ' ' + FirstName, you will have to change the query. Whereas, if you just bring in FirstName and LastName as separate fields and then concatenate them in Crystal using formula, you will have to just change formula.thank u so much. Anyway, it was just a simple example...you can get into more complex situations than this where implementing those chages at back-end level is simply unacceptable.Harsh AthalyeIndia."Nothing is Impossible"
thank u so much. |
 |
|
|