Click here to Skip to main content
15,921,295 members
Home / Discussions / Database
   

Database

 
GeneralRe: Server Object - Where to find the Dll ? Pin
Heath Stewart16-Dec-04 5:26
protectorHeath Stewart16-Dec-04 5:26 
GeneralRe: Server Object - Where to find the Dll ? Pin
Vector716-Dec-04 23:41
Vector716-Dec-04 23:41 
GeneralRe: Server Object - Where to find the Dll ? Pin
Heath Stewart17-Dec-04 1:00
protectorHeath Stewart17-Dec-04 1:00 
QuestionHow to databound listbox with three table relational structure? Pin
Origon15-Dec-04 22:31
Origon15-Dec-04 22:31 
GeneralReporting Service : custom parameter Pin
Member 150632215-Dec-04 5:42
Member 150632215-Dec-04 5:42 
GeneralHelp ! Selective SQL Statement Pin
RDoes15-Dec-04 1:16
RDoes15-Dec-04 1:16 
GeneralRe: Help ! Selective SQL Statement Pin
Michael Potter15-Dec-04 11:12
Michael Potter15-Dec-04 11:12 
GeneralRe: Help ! Selective SQL Statement Pin
Colin Angus Mackay15-Dec-04 12:28
Colin Angus Mackay15-Dec-04 12:28 
GeneralRe: Help ! Selective SQL Statement Pin
RDoes15-Dec-04 22:22
RDoes15-Dec-04 22:22 
GeneralRe: Help ! Selective SQL Statement Pin
Colin Angus Mackay16-Dec-04 2:26
Colin Angus Mackay16-Dec-04 2:26 
GeneralRe: Help ! Selective SQL Statement Pin
RDoes20-Dec-04 1:53
RDoes20-Dec-04 1:53 
GeneralRe: Help ! Selective SQL Statement Pin
Colin Angus Mackay20-Dec-04 2:19
Colin Angus Mackay20-Dec-04 2:19 
GeneralRe: Help ! Selective SQL Statement Pin
Jon Hulatt16-Dec-04 0:40
Jon Hulatt16-Dec-04 0:40 
GeneralRe: Help ! Selective SQL Statement Pin
RDoes16-Dec-04 0:52
RDoes16-Dec-04 0:52 
GeneralRe: Help ! Selective SQL Statement Pin
Michael Potter16-Dec-04 6:09
Michael Potter16-Dec-04 6:09 
GeneralRe: Help ! Selective SQL Statement Pin
Jon Hulatt16-Dec-04 22:26
Jon Hulatt16-Dec-04 22:26 
QuestionEmbedded SQL precompiler for C#? Pin
cellod14-Dec-04 12:05
cellod14-Dec-04 12:05 
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?

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.