Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Report SQL problem Post Reply Post New Topic
Author Message
AmitJ
Newbie
Newbie


Joined: 30 Dec 2010
Online Status: Offline
Posts: 14
Quote AmitJ Replybullet Topic: Report SQL problem
    Posted: 21 Apr 2011 at 3:50am

Hello ALL,

 

I have table test with following structure-

 

Test id

Test Name

Start Date

End Date

1

ABC

10-Jan-11

10-Jan-11

2

PQR

10-Jan-11

11-Jan-11

1

ABC

11-Jan-11

12-Jan-11

3

XYZ

10-Jan-11

12-Jan-11

 

I just want to display distinct record of Test ID and Test Name in my report based on selection of start date and End Date.

 

i have created record selection formula as

test.start date >={?St_Dt } and

test.end date<={?End_Dt}

 

I am using only Test Id and Test Name in my report however SQL generated by report is -

Select distinct Test ID,Test Name, Start Date,End Date

from Test

where Test.Start Date >= To_Date(''02-01-2011 00:00:00', 'DD-MM-YYYY HH24:MI:SS'') and

Test.End Date <= To_Date(''13-01-2011 00:00:00', 'DD-MM-YYYY HH24:MI:SS').

 

This SQL is giving me duplicate records of Test ID and Test Name.

 

How could i restrict start date and end date to appear in select clause of SQL.

 

Really appreciate your help on this.

 

Thanks in advance

Amit

 

IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 21 Apr 2011 at 6:56am
Try this:
 
- Group by either Test ID or Test Name, depending on how you want your data sorted.
- Put your data in the group header section.
- Suppress the details section and the group footer section.
 
-Dell
IP IP Logged
AmitJ
Newbie
Newbie


Joined: 30 Dec 2010
Online Status: Offline
Posts: 14
Quote AmitJ Replybullet Posted: 23 Apr 2011 at 11:29pm
Hello Dell..
 
Thanks for this solution.My issue is resolved with this.
 
Regards,
Amit
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.031 seconds.