Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Date formatting

Author  Topic 

cplusplus
Aged Yak Warrior

567 Posts

Posted - 2010-03-18 : 10:41:48
How to set the date formatting to dd/mm/yyyy
I a using this in my Sps:
rtrim(isnull(CONVERT(varchar(10),rv.RevisionDate,101),''))

Thank you very much for the info.

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2010-03-18 : 10:44:47
Where do you want to show formatted dates?

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

cplusplus
Aged Yak Warrior

567 Posts

Posted - 2010-03-18 : 10:49:27
Hello Madhivanan,

This field is used in constructing emailbody. there are almost 40 fields which need to appear in the email bod.
+''Revision Date: '' + rtrim(isnull(CONVERT(varchar(10),rv.RevisionDate,101),'''')) + char(13)

The dates are appearing with us format, need to show "dd/mm/yyyy"

Thank you.


quote:
Originally posted by madhivanan

Where do you want to show formatted dates?

Madhivanan

Failing to plan is Planning to fail

Go to Top of Page

cplusplus
Aged Yak Warrior

567 Posts

Posted - 2010-03-18 : 10:52:08
I guess i should use 103 instead of 101.

Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2010-03-18 : 10:52:51
Use

convert(varchar(10),rv.RevisionDate,103)

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2010-03-18 : 10:53:09


Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -