2

Below date format is not working in some computers I do know why,

SELECT FORMAT (getdate(), 'dd/MM/yyyy ') as date

I use SQL Query. What is the problem? Please anyone can help me

Sandra Rossi
  • 11,934
  • 5
  • 22
  • 48
Schadrack Rurangwa
  • 413
  • 12
  • 28
  • 5
    What do you mean with "not working"? – HoneyBadger Jul 22 '19 at 12:04
  • 1
    Please share error also, so that SO users can understand the situation better. – Tajinder Jul 22 '19 at 12:05
  • 1
    Msg 195, Level 15, State 10, Line 19 'format' is not a recognized built-in function name. Msg 156, Level 15, State 1, Line 33 Incorrect syntax near the keyword 'OR'. – Schadrack Rurangwa Jul 22 '19 at 12:13
  • 2
    "Some computers" = different DBMS? – Joakim Danielson Jul 22 '19 at 12:16
  • 2
    Format function is available in SQL 2012 and above, which version you are using? – Red Devil Jul 22 '19 at 12:19
  • 1
    Yes, SQL is 2008. But I have another server which has SQL 2012, Date format works fine to the server but it does not work to some client machines which connect to the server – Schadrack Rurangwa Jul 22 '19 at 12:31
  • 1
    I tried to convert variable instead of converting in SQL Query – Schadrack Rurangwa Jul 22 '19 at 15:03
  • So, SQL tells you a command is not available, and you do not bother to go to the documentation and read up in what version of SQL Server it became available AND you wonder how it does not work on a nearly 20 year old version of SQL Server. Is that about it? And you do not even make a bug report that investigates versions... 2008 is WAY old. – TomTom Mar 11 '20 at 15:48

1 Answers1

0

I tried to convert variable instead of converting in SQL Query

Schadrack Rurangwa
  • 413
  • 12
  • 28