News:

GinGly.com - Used by 85,000 Members - SMS Backed up 7,35,000 - Contacts Stored  28,850 !!

Main Menu

@@DATEFIRST

Started by sukishan, Aug 18, 2009, 08:04 PM

Previous topic - Next topic

sukishan

@@DATEFIRST
  Topic last updated -- July 2003

Returns the current value of the SET DATEFIRST parameter, which indicates the specified first day of each week: 1 for Monday, 3 for Wednesday, and so on through 7 for Sunday.

Syntax
@@DATEFIRST

Return Types
tinyint

Remarks
The U.S. English default is 7, Sunday.

Examples
This example sets the first day of the week to 5 (Friday), and assumes the current day, today, to be Saturday. The SELECT statement returns the DATEFIRST value and the number of the current day of the week.

SET DATEFIRST 5
SELECT @@DATEFIRST AS '1st Day', DATEPART(dw, GETDATE()) AS 'Today'
Here is the result set.

1st Day           Today
----------------  --------------
5                 2
A good beginning makes a good ending

dhoni

the syntax is datefirst in this sql server

it has small program to get datefirst

and sample program has also given to know easily