OliverR
Member
Hey guys,
I'm using a SQL statement to insert the date into a session field, but I can't seem to find how to format it to "dd/MM/yyyy" format (or any other format, for that matter).
Here's what I've got that's working so far:
That's simple enough. However, it doesn't give me the date in the desired format. I've tried
because that works for some SQL Server versions. I've also tried
as that seems to work for SQL Server 2012 and onwards. But neither of those work for TracerPlus, probably because TracerPlus doesn't use SQL Server
So how do I go about formatting the date? I would also need to do the same for the time, in a seperate field.
Thanks for any tips!
I'm using a SQL statement to insert the date into a session field, but I can't seem to find how to format it to "dd/MM/yyyy" format (or any other format, for that matter).
Here's what I've got that's working so far:
Code:
INSERT INTO Session1 SELECT GETDATE()
Code:
SELECT CONVERT(VARCHAR, GETDATE(), 103)
Code:
SELECT FORMAT (GETDATE(), 'dd/MM/yyyy')
So how do I go about formatting the date? I would also need to do the same for the time, in a seperate field.
Thanks for any tips!