0

I am trying to do exactly what this SO topic does, but it is not working and have no idea why.

My version is the following:

select convert(varchar, dateadd(ss, @tracker, 0), 114)

where @tracker is just an INT variable that holds a certain number of seconds.

The error I get is: Function DATEADD invoked with wrong number or type of argument(s).

Appreciate any help.

I am using Sybase.

Community
  • 1
  • 1
czchlong
  • 2,434
  • 10
  • 51
  • 65

1 Answers1

3

Ok, according to this documentation, you should use ss:

SELECT CONVERT(VARCHAR(12), DATEADD(ss, @tracker, "00:00:00"), 114)
Francis P
  • 13,377
  • 3
  • 27
  • 51
  • The error is: `Function DATEADD invoked with wrong number or type of argument(s).` – czchlong Oct 23 '12 at 17:27
  • Hey guys, tried all the suggestions, still not getting it, for testing my code is as simple as: `declare @tracker INT set @tracker = 1000 SELECT CONVERT(VARCHAR(12), DATEADD(second, 0, @tracker), 114)` – czchlong Oct 23 '12 at 17:33
  • I guess 0 isn't recognized as a date, try "0/0/0000" – Francis P Oct 23 '12 at 17:37