Skip to Content
author's profile photo Former Member
Former Member

SQL expression field is not displayed on the page header if no records

Hello

I'm creating a quite simple report. In this report I've got a SQL expression field which returns a DateTime

I display this field on the page header section.

Everything is working fine except when my principal query doesn't return any records my SQL expression field is not displayed. It doesn't seem to be evaluated.

So, I would display this field even if my Details Section doesn't contains any record.

I hope you understand what I mean.

Can someone help me?

thanks

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jul 17, 2008 at 12:07 PM

    Hello,

    I thought about creating a formula but the value I need is stored in a database.

    So i created a simple SQL expression field.

    (
    SELECT CONVERT(DATE,j_1) FROM VW_STD_DATEFIXING
    )

    And this expression doesn't have any dependencies.

    Add a comment
    10|10000 characters needed characters exceeded

    • The reason Fritz suggestion is the only way to accomplish this, is because an expression field, as stated in a previous post, is dependant on the main query of the report. Because no records are returned for the main sql, the sub query that you have defined in the expression will not be running at all. By placing it in a sub report, you are requiring that it run, even when no records are returned from the main query. Performance will be the same either way, because you are runnign a full sql statement in the expression field.

  • author's profile photo Former Member
    Former Member
    Posted on Jul 17, 2008 at 11:33 AM

    Hi

    Create a formula and keep it in the header section instead of using sql expressions. You can evaluate the datetime the way you want.

    Regarding why not displayed, You have to check the sql expression. There will be some dependecies and that would be the reason why not displayed.

    Regards

    Usama

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.