Desktop productivity for business analysts and programmers

Adding a Date Column to a Query with Today's Date

Reply
Occasional Contributor
Posts: 6

Adding a Date Column to a Query with Today's Date

I'd like to add a column to an existing query in EG that displays today's date in the result.

PROC Star
Posts: 1,605

Re: Adding a Date Column to a Query with Today's Date

[ Edited ]

column=today();

 

I don't know how to do that in EG using GUI

 

i assume there must be code editor or something, you would open up and find a sql query, if this is true

add the assignment in the select clause

 

today() as new_column

Valued Guide
Posts: 560

Re: Adding a Date Column to a Query with Today's Date

If you wish to use "Query Builder" point-and-click feature in SAS EG instead of programming then in query builder you have and option "Computed Column" at top right in query builder. Then navigate New>Advanced expression> Add TODAY() in expression window> assign column name, format and length accordingly.image.png

Thanks,
Suryakiran
Occasional Contributor
Posts: 6

Re: Adding a Date Column to a Query with Today's Date

Posted in reply to SuryaKiran
That one worked. I knew it was a relatively simple move - just didn't know where to start.
Thanks much for the response!
Ask a Question
Discussion stats
  • 3 replies
  • 101 views
  • 0 likes
  • 3 in conversation