|
-
Jul 19th, 2000, 08:13 AM
#1
Thread Starter
New Member
Im using VB 6.0 and Crystal Reports 7.0, and running the query command
Crystalreports1.SQLQUERY = "SELECT * FROM Table1 WHERE item=item1"
when I print the report I still get the entire database (that is all the items item1 - item100)
Does anyone know why? Is this a VB syntax error or a Crystal Reports design error?
Please help.
Thanks
TB
-
Jul 19th, 2000, 09:51 AM
#2
It seems like a problem with the way you formulated your SQL statement. If you want to select all the records where a field in the record matches a value stored in a variable, your code should have this form:
Crystalreports1.SQLQUERY = "SELECT * FROM Table1 WHERE FieldInTable = '" & strSomeVariable & "'"
"It's cold gin time again ..."
Check out my website here.
-
Jul 19th, 2000, 10:29 AM
#3
Thread Starter
New Member
In my code my select statement is in the format you sent. I've used the same statement successfully in my program to read and write from the database. My problem lies in letting Crystal reports know what to display at run time. Unfortunately the query variable changes everytime the user is running a report, so I cant use the SQLquery directly in Crystal reports and have to bind the report from VB.
Thanks for trying
TB
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|