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 |
|
azim
Starting Member
29 Posts |
Posted - 2002-02-23 : 14:24:14
|
| SQL="select * from absentees where studentid like '" val(text.text)"' and date like '"val(text2.text)"' and year like '" val(text3.text)"'" HOW I CAN WRITE THIS WITH CRYSTAL REPORT CODEBUT WITHOUT CRYSTALREPORT1.SQLQUERY BECAUSE IT'S SLOWazim |
|
|
andre
Constraint Violating Yak Guru
259 Posts |
Posted - 2002-02-25 : 10:05:20
|
I've never used Crystal Reports. However, from a SQL Server perspective, I suggest using stored procedures since they can speed up queries. In your case:CREATE PROCEDURE sp1 (t1 varchar(50),t2 varchar(50),t3 varchar(50)) ASSET NOCOUNT ONselect * from absentees where studentid like t1+'%' and date like t2+'%' and year like t3+'%';SET NOCOUNT OFF |
 |
|
|
Nazim
A custom title
1408 Posts |
Posted - 2002-02-25 : 10:19:08
|
| you can go to Crystal Reports MenuReports-> Edit Selection Formula->RecordType this{absentees.studentlike}>={@fromno} and {absentees.studentlike}<={@tono}Dont forget to create formula fields @fromno,@tono in your reportand pass the values thru VB using Form1.CrystalReport1.Formulas(0) = "@fromdate= " & val(text1.text) Form1.CrystalReport1.Formulas(1) = val(text2.text)but i would follow andre's suggestion.HTH--------------------------------------------------------------Edited by - Nazim on 02/25/2002 23:23:25 |
 |
|
|
|
|
|