Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Technical Questions
Message Icon Topic: How to write SQL query in Crystal Report 10 Post Reply Post New Topic
Author Message
gparul
Newbie
Newbie
Avatar

Joined: 03 Nov 2008
Location: India
Online Status: Offline
Posts: 10
Quote gparul Replybullet Topic: How to write SQL query in Crystal Report 10
    Posted: 18 Dec 2008 at 2:31am
Hi,
I am using ARS database system in Crystal report 10.
I want to write simple SQL query using SQL expression Editor box.
 
Is there any special way to write a query because simple SELECT query is also not working.
 
Please help me if anyone knows the solution.
 
Thanks in advance
Parul
IP IP Logged
rahulwalawalkar
Senior Member
Senior Member
Avatar

Joined: 08 Jun 2007
Location: United Kingdom
Online Status: Offline
Posts: 731
Quote rahulwalawalkar Replybullet Posted: 18 Dec 2008 at 2:34am
Hi Parul,
 
use the command object .... and write the sql there.
 
Cheers
Rahul
IP IP Logged
gparul
Newbie
Newbie
Avatar

Joined: 03 Nov 2008
Location: India
Online Status: Offline
Posts: 10
Quote gparul Replybullet Posted: 18 Dec 2008 at 3:04am
Hi Rahul,
In that "Add Command"  object i tried following query :
 
SELECT rownum from HPD_HelpDesk
 
which is giving me error that "rownum not found".
What will be the problem?
 
Thanks a lot for your reply.
Parul
 
 
IP IP Logged
rahulwalawalkar
Senior Member
Senior Member
Avatar

Joined: 08 Jun 2007
Location: United Kingdom
Online Status: Offline
Posts: 731
Quote rahulwalawalkar Replybullet Posted: 18 Dec 2008 at 3:33am
Hi
 
Do you have access to SQL Server what happens when you write the same query in SQL ,how are you connecting to AR system database ?
 
As per my understanding ROWNUM is not available in SQL SERVER ,you can try using RANK () or ROW_NUMBER keyword in sql server 2005
 
in sql server 2000 use  code as below
 

Select *,(Select count(*) from table a cnt

where a.id >= o.id) as RowID

FROM table o

order by rowid

Cheers
Rahul


Edited by rahulwalawalkar - 18 Dec 2008 at 3:33am
IP IP Logged
gparul
Newbie
Newbie
Avatar

Joined: 03 Nov 2008
Location: India
Online Status: Offline
Posts: 10
Quote gparul Replybullet Posted: 18 Dec 2008 at 10:20pm
Hi Rahul,
It is still giving me error when i am using following query in the "Add Command" object of crystal report 10:
 
"select count(*) as RowID from HPD_HelpDesk order by RowID"
 
ERROR:
Column Not Found : RowID.
 
Thanks a lot ,
Parul
 
 
 
 
 
 
 
IP IP Logged
JohnT
Groupie
Groupie
Avatar

Joined: 20 Jan 2008
Online Status: Offline
Posts: 92
Quote JohnT Replybullet Posted: 19 Dec 2008 at 7:09am

Are you trying to use RowID or rownum because your report requires it or are you just trying to use it to write a simple query ?  If you don't need it, I would suggest you pick a field that exists in HPD_HelpDesk and use it in your query.  That might help you debug your problem.

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.