How to get current date

If you rather not have an error then if you associate a table with the object then it will parse ok. Click the tables button and choose a table.

Without a table associated then your SQL statement is literally,

SELECT getdate()

which obviously is incomplete. If you associate a table, say DIM_CALENDAR then you get,

SELECT getdate() FROM DIM_CALENDAR

which will parse fine. However this statement will return multiple rows so you’ll need to consider how this object will be used by users and then decide which table is best associated with this object if any. For a discussion of pros and cons of using system dates see this article. And also see this article.

rgds

AL


agulland :uk: (BOB member since 2004-03-17)