Data Connectivity
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Data Connectivity
Message Icon Topic: SQL in Crystal gives “blank” but works in SQL Serv Post Reply Post New Topic
Author Message
WGroleau
Newbie
Newbie


Joined: 07 Mar 2012
Online Status: Offline
Posts: 2
Quote WGroleau Replybullet Topic: SQL in Crystal gives “blank” but works in SQL Serv
    Posted: 07 Mar 2012 at 5:08am

I was asked to add an "as of" date to an Existing Crystal report.

I went into SQL Server (management studio), and figured out how to get a single date meeting the requirement.

Then I copy/pasted the SQL into Crystal's "add command" box. When I put that field in the report footer, it is empty. Go back to SQL server, and it still gives the date I expect.

Checked the formatting properties--it isn't that.

Is there a fix for this?

Normally, I would put the SQL in the server as a stored procedure or function, but it's a vendor-supplied DB that I am not allowed to alter. Can't use profiler for the same reason.

Found a blog article where someone claimed that Crystal demands column names and aliases (but not table names) to be in double quotes. Found that hard to believe but I tried it. No change.

IP IP Logged
rkrowland
Senior Member
Senior Member
Avatar

Joined: 20 Dec 2011
Location: England
Online Status: Offline
Posts: 259
Quote rkrowland Replybullet Posted: 07 Mar 2012 at 5:28am
What's the SQL code for the field you're trying to create so I can try and replicate?
 
The double quotes thing is a lie, I use SQL commands in Crystal all the time and I've never once used double quotes.
 
Regards,
Ryan.
IP IP Logged
kevlray
Admin Group
Admin Group
Avatar

Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Quote kevlray Replybullet Posted: 07 Mar 2012 at 6:35am
The double quotes are handy if the table, field names are separated by an space (i.e, Adult ID, "Adult ID")
IP IP Logged
WGroleau
Newbie
Newbie


Joined: 07 Mar 2012
Online Status: Offline
Posts: 2
Quote WGroleau Replybullet Posted: 07 Mar 2012 at 7:21am
Originally posted by rkrowland

What's the SQL code ...
SELECT CONVERT(VARCHAR(25), MAX(END_TIME), 120) AS DTG
  FROM CLARITY_EXT_BENCH
 WHERE TABLE_NAME = 'ARPB_TRANSACTIONS';
Originally posted by rkrowland

The double quotes thing is a lie,....
Like I said, it was hard to believe...
IP IP Logged
kevlray
Admin Group
Admin Group
Avatar

Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Quote kevlray Replybullet Posted: 07 Mar 2012 at 10:17am
The SQL looks pretty straightforward.  Just as a test, have you tried taking of the where clause to see if you get any data?
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.