March 12, 2015 at 7:52 am
Date format in DB is 2002-11-04 00:00:00.000, I need to convert this to 04/11/2002 (UK date format). Have tried CONVERT(VARCHAR(10),103) but with no results. I would appreciate any advice.
March 12, 2015 at 8:01 am
If it's stored as a varchar you'll need to convert it to a datetime first then convert it to the formatted date you want.
March 12, 2015 at 9:26 am
p.bradley (3/12/2015)
Date format in DB is 2002-11-04 00:00:00.000, I need to convert this to 04/11/2002 (UK date format). Have tried CONVERT(VARCHAR(10),103) but with no results. I would appreciate any advice.
CONVERT(VARCHAR(10),103) will not do it CONVERT(VARCHAR(10),yourdate,103) might.
What app are you using? Can it format?
March 12, 2015 at 10:14 am
Note that if you format your date it won't be a date any more and it will be a string. String dates will give you problems if you try to order them.
That's why dates should be formatted on the presentation layer.
March 12, 2015 at 10:14 am
Correction, my apologies, I am using CONVERT(VARCHAR(10),GETDATE(),103). The application is software text messaging which requires the date in dd/mm/yyyy, as far as I know it does not format.
March 12, 2015 at 11:21 am
p.bradley (3/12/2015)
Correction, my apologies, I am using CONVERT(VARCHAR(10),GETDATE(),103). The application is software text messaging which requires the date in dd/mm/yyyy, as far as I know it does not format.
That should work fine SELECT CONVERT(VARCHAR(10),GETDATE(),103) returns 12/03/2015, what problem are you having with it?
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply