-1

I am a newbie to programming. I downloaded the free version of SQL Server 2014, the Express edition. Somehow the Getdate() function is not working. It says

Incorrect syntax near '('.

If I just say GETDATE. It says

Could not find stored procedure 'GETDATE'.

Can someone tell me if some library is missing from my installation?

I tried reinstalling the software assuming that some libraries were missing.

getdate() is what I am trying. Even the Datepart() and any of the date functions does not work.

Could you please help me to resolve the above issues and guide on the correct syntax?

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459

2 Answers2

1

To do it work you need to add select.

SELECT GETDATE()
M. Kanarkowski
  • 2,155
  • 8
  • 14
1

GETDATE() is a function, you need to close the parentheses and add SELECT clause.

Type SELECT GETDATE();

And check the oficial docs: GETDATE (Transact-SQL)

Rafael Lima
  • 420
  • 1
  • 5
  • 16