473,398 Members | 2,525 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

Changing the day of week in SQL Server 2000

Dear All,

I have one field in my table which shows the day of the week. It is
showing

Sunday = 1
Monday = 2
Tuesday = 3

But i want Monday is the first day. I know i can use DATEFIRST to
change it but it works in Query Analyzerbut when i come and see my
table it is showing the old settings. Is it possible i can change it
permanently. Any help in this regard will be higly appreciated

Regards

S
Jul 23 '05 #1
2 7408
Hi Neha

It is not clear what you are trying to do or how your data is being held,
posting DDL (create table statements) and example data (as insert
statements) will remove any ambiguity
http://www.aspfaq.com/etiquette.asp?id=5006

If the day of the week in your table is data it will need to be updated. If
it is currently held as a value 1-7
with Sunday = 1... then try the statement

UPDATE MyTable
SET DayOfWeek = CASE WHEN DayOfWeek = 1 THEN 7 ELSE DayOfWeek - 1 END

Using SET DATEFIRST will change the settings for the current session,
therefore you will need to make sure it is set currectly before issuing your
statement. Alternatively datefirst can be change if a different default
language is specified, to check the current language use sp_helplanguage
@@LANGUAGE. sp_helplanguage with no parameters will show you what the values
are for each language. To change the default language use sp_configure (see
Books online for more information)

John

"Neha" <ne********@hotmail.com> wrote in message
news:76*************************@posting.google.co m...
Dear All,

I have one field in my table which shows the day of the week. It is
showing

Sunday = 1
Monday = 2
Tuesday = 3

But i want Monday is the first day. I know i can use DATEFIRST to
change it but it works in Query Analyzerbut when i come and see my
table it is showing the old settings. Is it possible i can change it
permanently. Any help in this regard will be higly appreciated

Regards

S

Jul 23 '05 #2
John Bell (jb************@hotmail.com) writes:
Using SET DATEFIRST will change the settings for the current session,
therefore you will need to make sure it is set currectly before issuing
your statement. Alternatively datefirst can be change if a different
default language is specified, to check the current language use
sp_helplanguage @@LANGUAGE. sp_helplanguage with no parameters will show
you what the values are for each language. To change the default
language use sp_configure (see Books online for more information)


What you change with sp_configure is the default language for new
logins.

To change the default language for an existing login, use
sp_defaultlanguage.
--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Jul 23 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Stig Andersen | last post by:
Hi does anyone know how to make MS SQL server 2000 calculate the right week number around new year ? According to the help file, MSSQL should follow ISO8601, which ensures that i.e. 2003 has...
13
by: SimonC | last post by:
I would like to return data from the last 2 weeks of each given month in Javascript, but in 2 formats. So, the penultimate week (Monday to Sunday) and the last week (Monday to ??) I'm not...
13
by: Peter | last post by:
Can anyone tell me how to change the data type of a field in a table created with a make table query? The field is a binary and must be changed to text. alternately does anyone know how to specify...
3
by: mark | last post by:
HELP!!! Last week we moved the Server From 1 Location to Another that was running Replication Manager 4.0. (We changed the IP Addresses and changed the name servers also... ) After the...
8
by: Robert Misiak | last post by:
Is it possible to manually change the auto-build number used in VS.NET? Thanks, Robert
1
by: Chumley Walrus | last post by:
I'm changing an old classic asp script over to asp.net; it displays links corresponding to each day of the week <script runat="server"> Sub Page_Load(s As Object, e As EventArgs) ...
5
by: soulkitchen | last post by:
After I change a fairly complex stored procedure and I run a report against it, crystal hangs at "assesing database". I have verified the database. When I run a trace on SQL is shows repeated...
8
by: Phil Reynolds | last post by:
I have a single text box (a large one) in a form that pops up. I want the text box to change size as the user changes the size of the form. However, doing me.txtbox.width = me.width doesn't work,...
29
by: Neil | last post by:
Running a SQL 7 system on a Windows 2000 server using Access 2000 on client machines as a front end. System administrator currently reboots the server once a month. Yesterday we had some weird...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.