How to Insert Queries with different filters in Crystal Report

Ninnad Jagtap

Active member
Joined
Apr 12, 2005
Messages
35
Programming Experience
Beginner
I want to generate a report which fetches data from just one table but i have four selection mode for that which can be used in multiple ways so for doing so the minimum set of QuERy with Four Different Where clauses are required and i want to insert the same in one crystal report how to do that .. seding the SQL Queries that i have to insert into the Report

case 1
strSQL = "SELECT CUPCUSTOMERCODE as [Customer Code],CUPNAME as [Name],CUPADDRESS as [Address],CUPCHEQUECREDIBLE as [Accept Cheque],CUPCREDITMODE as [Credit],CUPMODIFIEDBY as [Modified By],CUPMODIFIEDON as [Modified On] " & _

"FROM COCUSTOMERPROFILE " & _

"WHERE " & _

"CUPIMPORTCHA " & cImportCHA & " AND " & _

"CUPEXPORTCHA " & cExportCHA & " AND " & _

"CUPLINER = 'Y' AND " & _

"CUPSHIPPER = 'Y' AND " & _

"CUPMODIFIEDON BETWEEN '" & strFromDate & "' AND '" & strToDate & "'"

Case 2

strSQL = "SELECT CUPCUSTOMERCODE as [Customer Code],CUPNAME as [Name],CUPADDRESS as [Address],CUPCHEQUECREDIBLE as [Accept Cheque],CUPCREDITMODE as [Credit],CUPMODIFIEDBY as [Modified By],CUPMODIFIEDON as [Modified On] " & _

"FROM COCUSTOMERPROFILE " & _

"WHERE " & _

"CUPIMPORTCHA " & cImportCHA & " AND " & _

"CUPEXPORTCHA " & cExportCHA & " AND " & _

"CUPLINER = 'Y' AND " & _

"CUPMODIFIEDON BETWEEN '" & strFromDate & "' AND '" & strToDate & "'"

Case 3

strSQL = "SELECT CUPCUSTOMERCODE as [Customer Code],CUPNAME as [Name],CUPADDRESS as [Address],CUPCHEQUECREDIBLE as [Accept Cheque],CUPCREDITMODE as [Credit],CUPMODIFIEDBY as [Modified By],CUPMODIFIEDON as [Modified On] " & _

"FROM COCUSTOMERPROFILE " & _

"WHERE " & _

"CUPIMPORTCHA " & cImportCHA & " AND " & _

"CUPEXPORTCHA " & cExportCHA & " AND " & _

"CUPSHIPPER = 'Y' AND " & _

"CUPMODIFIEDON BETWEEN '" & strFromDate & "' AND '" & strToDate & "'"

Case 4

strSQL = "SELECT CUPCUSTOMERCODE as [Customer Code],CUPNAME as [Name],CUPADDRESS as [Address],CUPCHEQUECREDIBLE as [Accept Cheque],CUPCREDITMODE as [Credit],CUPMODIFIEDBY as [Modified By],CUPMODIFIEDON as [Modified On]" & _

"FROM COCUSTOMERPROFILE " & _

"WHERE " & _

"CUPIMPORTCHA " & cImportCHA & " AND " & _

"CUPEXPORTCHA " & cExportCHA & " AND " & _

"CUPMODIFIEDON BETWEEN '" & strFromDate & "' AND '" & strToDate & "'"

PLZ. Help


 
Back
Top