Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Select Query problem in Add Command Post Reply Post New Topic
Author Message
CRMSFDC
Newbie
Newbie


Joined: 04 Dec 2008
Online Status: Offline
Posts: 13
Quote CRMSFDC Replybullet Topic: Select Query problem in Add Command
     Posted: 26 Feb 2009 at 11:22pm
hi,

I wrote a simple select query in Add command but I'm getting "Failed to retrieve data" error and syntax error.

Code:

SELECT User.'Name' from User


Help me out!!

Thanks.
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 27 Feb 2009 at 7:06am
have you tried select [user].[name] from [user]?
 
never seen the use of single quotes since that is a text string in SQL Server and makes no sense in the context of the sample.
 
Hope this helps
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 27 Feb 2009 at 7:35am
I think you are trying to use a filter here and you put the 'user' as a place holder for what you want to filtered by.
 
It will be much easier for you to just use the select expert in Crystal to do this for you.
Click on the Select expert .
Select the 'user name field' and then change the firswt option to "is equal to"then use the other pick list to select the item you want it to equal (it will show al values from the DB).
IP IP Logged
KevinBond
Newbie
Newbie
Avatar

Joined: 08 Jul 2008
Location: Canada
Online Status: Offline
Posts: 10
Quote KevinBond Replybullet Posted: 27 Feb 2009 at 8:23am
This may be abvious, but are you signed in as the table owner?  If not, you will need to include the name before the table name.  Just a thought...
IP IP Logged
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