June 26, 2008 at 5:38 am
Hi everyone,
Could any one tell me that how to configure dateformat in database or server?
With regards,
Sunil
June 26, 2008 at 5:49 am
you don't. 😉
- Use datatime datatype for date or time or datetime columns.
This way you are sure valid dates are entered, and you have a bunch of datetime related functions to your availability.
-formatting is a client matter, so this should be done at client side.
If you ensist on formatting date in query analyzer you can user
select convert(char(26), getdate(),121) as mycurrentdatetime
Check books online for more info on convert.
Johan
Learn to play, play to learn !
Dont drive faster than your guardian angel can fly ...
but keeping both feet on the ground wont get you anywhere :w00t:
- How to post Performance Problems
- How to post data/code to get the best help[/url]
- How to prevent a sore throat after hours of presenting ppt
press F1 for solution, press shift+F1 for urgent solution 😀
Need a bit of Powershell? How about this
Who am I ? Sometimes this is me but most of the time this is me
June 26, 2008 at 6:23 am
I know that query but problem was different.
June 26, 2008 at 6:40 am
Do you mean the Server overall(windows or SQL Server)
Pl specify in detail.
Or if it is SQL Server Date Format:
Check BOL for SET DATEFORMAT Syntax
SET DATEFORMAT mdy;
SET DATEFORMAT ydm;
more on BOL
Maninder
www.dbanation.com
June 26, 2008 at 7:04 am
Could u tell me that how I can set datetime datatype in yyyy-mm-dd format.
June 26, 2008 at 7:11 am
SET DATEFORMAT ymd
Maninder
www.dbanation.com
June 26, 2008 at 7:11 am
Check this Query from BOL.
DECLARE @datevar DATETIME;
SET @datevar = '1998/12/31';
SELECT @datevar AS DateVar;
Maninder
www.dbanation.com
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply