Domanda

Im not too sure of the syntax for SQL Expression Fields, can someone please advise? Am I correct in saying I don't need the a table in the list under datasources to read data from, I thought we could query on the fly with this method?

I have this simple query:

Case When BreachDateTime > = Getdate() then 'In Date'
Else 'Out Of Date'
End
From mytable

Basically I want to add the In Date or Out of Date field to the details on the CR. is the syntax correct, I get no errors although I need advise generally and also do I need to bring the table across or will it do it on the fly, I don't want to pull the hole db tables into the report list but as the adbc connection goes I should have access to the whole table structure on the fly, hopefully?

Thanks

È stato utile?

Soluzione

If mytable is a member of the main query, then the syntax is:

(
Case When BreachDateTime >= Getdate() Then 'In Date'
Else 'Out Of Date' End
)

otherwise:

(
SELECT  Case When BreachDateTime >= Getdate() Then 'In Date'
        Else 'Out Of Date' End
FROM    mytable
)

If mytable is a member of the main query, you could replace a sql-expression field with a formula field:

// {@foobar}
IF {mytable.BreachDateTime} > = DataDate Then 'In Date'
Else 'Out Of Date' End
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top