Wrox Programmer Forums
Go Back   Wrox Programmer Forums > SQL Server > SQL Server 2000 > SQL Server 2000
|
SQL Server 2000 General discussion of Microsoft SQL Server -- for topics that don't fit in one of the more specific SQL Server forums. version 2000 only. There's a new forum for SQL Server 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2000 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 12th, 2004, 01:03 AM
Authorized User
 
Join Date: Jul 2003
Posts: 71
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to change Date Settings in the Server

Select dbo.Fin_tblTransJournalVoucher.JVdate,DATEDIFF(Day , dbo.Fin_tblTransJournalVoucher.JVdate, CONVERT(DATETIME,
                      '2004-02-15 00:00:00', 102)) AS Days from dbo.Fin_tblTransJournalVoucher

This Query Used to Give me (2004-01-03|43), Just Yesteray it become
(2004-03-01|-15)

What Happened? How Do I Revert the Settings?




Proud To Be Pinoy
__________________
Proud To Be Pinoy
 
Old July 12th, 2004, 08:38 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

What format does JVdate show off? Why not use the same format for both the dates within datediff?

Code:
Select dbo.Fin_tblTransJournalVoucher.JVdate, 
    DATEDIFF(Day, CONVERT(datetime,dbo.Fin_tblTransJournalVoucher.JVdate,102), 
    CONVERT(DATETIME,'2004-02-15 00:00:00', 102)) AS Days 
from dbo.Fin_tblTransJournalVoucher
Also check what format is set as default for your sql server.

Cheers!
_________________________
- Vijay G
Strive for Perfection
 
Old July 12th, 2004, 08:16 PM
Authorized User
 
Join Date: Jul 2003
Posts: 71
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Before it shows me this values "2004-01-03" now its "2004-03-01". If I will change the it in datediff it will have have to reprogram a lot of things.

I am more interested in knowing and changing what is the default of my sql server. The problem is I dont know how to do it. Can you teach me?


Proud To Be Pinoy
 
Old July 13th, 2004, 01:57 AM
Authorized User
 
Join Date: Jul 2004
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I believe sql server gets its settings from the regional settings set on your computer. So you should change that from regional options.

 
Old July 13th, 2004, 07:08 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

Yes, you can get that set in you regional settings. Someone might have changed that, which effects your current date format.

What Language is set to DEFAULT in your SQL server? Is that set to the one you wanted? I believe changing that might affect date format too.

Either by changing the regional settings options / set default to desired Language and reboot the server. This could effect the date format. May be if that doesn't sometimes change the values in registry, then you can manually change the needed values in the registry under hkey_users\.DEFAULT\control panel\international

Hope that helps.
Cheers!

_________________________
- Vijay G
Strive for Perfection
 
Old July 13th, 2004, 07:49 PM
Authorized User
 
Join Date: Jul 2003
Posts: 71
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thank you very for the tip, just saved me from reformatting my computer. :D

Proud To Be Pinoy





Similar Threads
Thread Thread Starter Forum Replies Last Post
Change default newsletter settings vantoko BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 2 March 28th, 2008 03:19 AM
Programmatically Change Printer Settings vempativenu Beginning VB 6 0 September 2nd, 2004 06:29 AM
How to change Regional Settings through VB zee_ahmed2002 Pro VB 6 2 July 26th, 2004 04:24 AM
How do I change the Server Date and Time happygv SQL Server 2000 4 January 5th, 2004 11:28 AM
Proxy Server Settings??? - Help! javacelt JSP Basics 0 November 1st, 2003 06:19 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.