0

I currently have a SQL query that selects and creates a report from a specified SQL Database (Rational Data Warehouse). This report will merely include the columns I have selected from different tables, nothing else.

I want to add a command to the query that creates a "Date" column in the report and then fills every row that does not have nulls with the current date. Is there such a query function that could do this?

Vikrant
  • 4,920
  • 17
  • 48
  • 72
Sirmeow
  • 1
  • 1
  • 1
    What have you already tried? – TRose Sep 05 '19 at 18:08
  • Doing a bit more research I've realized that that I don't think that it is actually possible to add brand new columns in Jazz's Report Builder. So I think now my question is moot :( – Sirmeow Sep 05 '19 at 18:45

1 Answers1

0

I've never used RDW but most SQL database systems have a function that returns the current date/time. To include the output of a function in a query output you call the function and give it an alias

if i had a query of:

SELECT firstname, lastname
FROM person

and i wanted the date in there, in eg MS SQL server i would do:

SELECT firstname, lastname, getutcdate() as curdate
FROM person

have a look in the manual for your database to see what it's "current datetime" function is (i did have a quick google but didn't find a SQL dbms called "rational data warehouse")

Caius Jard
  • 72,509
  • 5
  • 49
  • 80