DataEnvironment1.rsCommand1.Open "select * from patients where ID & Lastname & Givenname & DateNow = ''" DataReport4.Refresh DataReport4.Show DataEnvironment1.rsCommand1.Close
Page 1 of 1
1 Replies - 4652 Views - Last Post: 14 December 2013 - 06:04 AM
Printig selected record in data report vb 6
Posted 14 December 2013 - 05:22 AM
can someone help me?. I'm having a trouble displaying filter records in data report. I'm trying to print the selected records by date using filter,but when I print it, all the data in database are display instead of the selected records. Can someone help me.thank you. Here is my code
Replies To: Printig selected record in data report vb 6
Re: Printig selected record in data report vb 6
Posted 14 December 2013 - 06:04 AM
"select * from patients where ID & Lastname & Givenname & DateNow = ''"
This is incorrect sql. Sql doesn't use the ampersand & for concatenation. In many sql dialects, '+' is used.
Your statement also assumes that these are all text-fields, containing the empty string ''. You would do better to check each of the four fields individually, some of which may be NULL (I assume).
This post has been edited by andrewsw: 14 December 2013 - 06:09 AM
Page 1 of 1