Page 1 of 1

Setting a Derivation to '0001-01-01'

Posted: Mon Dec 21, 2015 2:41 pm
by ScottDun
Hi,

I am trying to default a column, with a Timestamp datatype, to '0001-01-01'. Is there a function that will do that? I typed in the 0001-01-01 and all that was returned were stars because I did not have a function. Any help would be great. Thanks!

Posted: Mon Dec 21, 2015 3:12 pm
by chulett
StringToTimestamp. And you'll need a time as well, even if it's all zeroes.

Posted: Mon Dec 21, 2015 3:25 pm
by ScottDun
StringToTimestamp(0001-01-01 00:00:00,[%"%yyyy-%mm-%dd %hh:%nn:%ss"%])

I input this and it isn't working.

Posted: Mon Dec 21, 2015 3:29 pm
by ScottDun
I also took out the '%' in front and back of the quotes....

StringToTimestamp(0001-01-01 00:00:00,["%yyyy-%mm-%dd %hh:%nn:%ss"])

Posted: Mon Dec 21, 2015 3:37 pm
by samyamkrishna
Try
StringToTimestamp("0001-01-01 00:00:00","%yyyy-%mm-%dd %hh:%nn:%ss")

Posted: Mon Dec 21, 2015 3:38 pm
by chulett
You need quotes around your string and there's no square brackets needed.

:!: Also there's no need to quote everything all the time, rather than 'Reply with quote' simply use the Reply to topic link. Save the quoting for when it makes sense.