use Sum, convert, MIN, MAX

Hello, when I load a SQL query into a jasper studio report, the columns in which Sum, convert, MIN, MAX are used are either empty, or it says which column is counted. How to fix it?

Attachments: 
deadsploid's picture
Joined: Nov 9 2022 - 1:06am
Last seen: 2 hours 30 min ago

1 Answer:

Assuming the SQL is correct you should provide an alias for each column by adding "as" followed by the alias name.

SELECT CONVERT(VARCHAR(10), MIN(DateBeginPeriod), 103) AS StartDate
     , CONVERT(VARCHAR(10), MAX(DateEndPeriod), 103)   AS EndDate
FROM UnmeteredConsumption

jgust's picture
5487
Joined: Jun 10 2010 - 6:39am
Last seen: 20 hours 9 min ago
Feedback
randomness