Click here to Skip to main content
15,895,667 members
Home / Discussions / Database
   

Database

 
GeneralLocal SQL server name Pin
RoyceF13-Dec-04 11:59
RoyceF13-Dec-04 11:59 
GeneralRe: Local SQL server name Pin
Colin Angus Mackay13-Dec-04 12:20
Colin Angus Mackay13-Dec-04 12:20 
GeneralRe: Local SQL server name Pin
RoyceF13-Dec-04 12:45
RoyceF13-Dec-04 12:45 
GeneralRe: Local SQL server name Pin
Irsh15-Dec-04 0:02
Irsh15-Dec-04 0:02 
GeneralRe: Local SQL server name Pin
RoyceF15-Dec-04 5:47
RoyceF15-Dec-04 5:47 
GeneralRe: Local SQL server name Pin
Veera Raghavendra16-Dec-04 17:23
Veera Raghavendra16-Dec-04 17:23 
GeneralRe: Using DATEFIRST in a View - I want the week to start on Monday instead of Sunday. Pin
tojamismis13-Dec-04 6:52
tojamismis13-Dec-04 6:52 
GeneralUsing DATEFIRST in a View - I want the week to start on Monday instead of Sunday. Pin
Tony Manhollan13-Dec-04 6:11
Tony Manhollan13-Dec-04 6:11 
I'm trying to select records where a date occurs between today and the end of the current week with Sunday as the last day of the week. I'd do this with the following code:

SET DATEFIRST 1
SELECT * FROM sometable WHERE recordDate BETWEEN GETDATE() AND DATEADD(d, 7 - DATEPART(dw, GETDATE()), GETDATE()))

This works great, except that I need to make a View that returns this recordset. SET DATEFIRST 1 is not valid in CREATE VIEW.

I also tried making a User Defined Function that returns the date at the end of the week using the logic in the second part of the BETWEEN, but the SET DATEFIRST 1 is not valid in the function either.

Anyone know how I can get my intended result -- the date on sunday of the current week?
GeneralRe: Using DATEFIRST in a View - I want the week to start on Monday instead of Sunday. Pin
tojamismis13-Dec-04 6:48
tojamismis13-Dec-04 6:48 
GeneralLines of Invoice Pin
ruifernandes2412-Dec-04 11:13
ruifernandes2412-Dec-04 11:13 
GeneralRe: Lines of Invoice Pin
Edbert P12-Dec-04 13:12
Edbert P12-Dec-04 13:12 
Generalinsert string wiht ' chare Pin
Anonymous12-Dec-04 5:43
Anonymous12-Dec-04 5:43 
GeneralRe: insert string wiht ' chare Pin
DavidNohejl12-Dec-04 7:16
DavidNohejl12-Dec-04 7:16 
GeneralRe: insert string wiht ' chare Pin
Edbert P12-Dec-04 13:14
Edbert P12-Dec-04 13:14 
General.Net/COM+ Pin
Member 131282211-Dec-04 22:31
Member 131282211-Dec-04 22:31 
GeneralUpdating SQL Server 2000 with varying column names Pin
ColdWaterBlue11-Dec-04 16:03
ColdWaterBlue11-Dec-04 16:03 
GeneralRe: Updating SQL Server 2000 with varying column names Pin
Mekong River11-Dec-04 16:53
Mekong River11-Dec-04 16:53 
GeneralRe: Updating SQL Server 2000 with varying column names Pin
ColdWaterBlue11-Dec-04 21:13
ColdWaterBlue11-Dec-04 21:13 
GeneralFinding lowest integer in an Access Database Pin
pjholliday11-Dec-04 11:24
pjholliday11-Dec-04 11:24 
GeneralRe: Finding lowest integer in an Access Database Pin
Mekong River11-Dec-04 16:59
Mekong River11-Dec-04 16:59 
GeneralRe: Finding lowest integer in an Access Database Pin
pjholliday12-Dec-04 2:24
pjholliday12-Dec-04 2:24 
GeneralRe: Finding lowest integer in an Access Database Pin
Edbert P12-Dec-04 13:24
Edbert P12-Dec-04 13:24 
GeneralUrgent ! Doubt in Sql Pin
goldsuji11-Dec-04 0:54
goldsuji11-Dec-04 0:54 
GeneralRe: Urgent ! Doubt in Sql Pin
venadder11-Dec-04 8:42
venadder11-Dec-04 8:42 
GeneralRe: Urgent ! Doubt in Sql Pin
goldsuji12-Dec-04 19:48
goldsuji12-Dec-04 19:48 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.