Click here to Skip to main content
15,917,516 members
Home / Discussions / Database
   

Database

 
GeneralRe: Use ' one quotation make error with sql statmetn .. Pin
kindman_nb8-Jul-07 10:58
kindman_nb8-Jul-07 10:58 
GeneralRe: Use ' one quotation make error with sql statmetn .. Pin
Sam Heller8-Jul-07 11:05
Sam Heller8-Jul-07 11:05 
GeneralRe: Use ' one quotation make error with sql statmetn .. Pin
kindman_nb8-Jul-07 11:52
kindman_nb8-Jul-07 11:52 
GeneralRe: Use ' one quotation make error with sql statmetn .. Pin
Sam Heller8-Jul-07 11:53
Sam Heller8-Jul-07 11:53 
GeneralRe: Use ' one quotation make error with sql statmetn .. Pin
N a v a n e e t h8-Jul-07 23:03
N a v a n e e t h8-Jul-07 23:03 
Questiongetting error "“Invalid object name 'SizeMst'. “ " while exec sp Pin
mohd imran abdul aziz6-Jul-07 20:08
mohd imran abdul aziz6-Jul-07 20:08 
Questiona month all dates want to display..., Pin
Member 38798816-Jul-07 18:14
Member 38798816-Jul-07 18:14 
AnswerRe: a month all dates want to display..., Pin
Mike Dimmick7-Jul-07 2:32
Mike Dimmick7-Jul-07 2:32 
Constructing a date is actually pretty tricky in SQL Server. It's easiest to start from 1 January of the desired year, using a string literal:
DECLARE @startDate datetime
DECLARE @endDate datetime
 
-- note use of ISO8601 yyyyMMdd format - unambiguous
SET @startDate = CAST( CAST( @year AS varchar(4) ) + '0101' AS datetime )
Then you can add the month information:
-- Month is 1-based but we don't want to add anything for January
-- so we subtract 1 from the supplied month number
SET @startDate = DATEADD( m, @month - 1, @startDate )
In the results, we want anything up to 30 June 2007 23:59:59, so I set the end date to be the start date plus one month and then select values greater than or equal to the start date, and less than the end date.
SET @endDate = DATEADD( m, 1, @startDate )
If you really want the last day of the month, you can subtract one day with DATEADD( d, -1, @endDate ).

Stability. What an interesting concept. -- Chris Maunder

GeneralRe: a month all dates want to display..., Pin
Member 38798818-Jul-07 19:10
Member 38798818-Jul-07 19:10 
GeneralRe: a month all dates want to display..., Pin
Pete O'Hanlon8-Jul-07 23:05
mvePete O'Hanlon8-Jul-07 23:05 
Questionms access +c#.net (date comparison) Pin
hk779216-Jul-07 8:48
hk779216-Jul-07 8:48 
QuestionNetwork error while connecting to DB2/MVS from .Net Pin
viv_bhatt6-Jul-07 5:55
viv_bhatt6-Jul-07 5:55 
AnswerRe: Network error while connecting to DB2/MVS from .Net Pin
Mike Dimmick6-Jul-07 6:38
Mike Dimmick6-Jul-07 6:38 
GeneralRe: Network error while connecting to DB2/MVS from .Net Pin
viv_bhatt6-Jul-07 7:17
viv_bhatt6-Jul-07 7:17 
Questionsql query Pin
Laxmi R6-Jul-07 3:58
Laxmi R6-Jul-07 3:58 
AnswerRe: sql query Pin
Vishu Gurav6-Jul-07 11:11
Vishu Gurav6-Jul-07 11:11 
AnswerRe: sql query Pin
Mike Dimmick6-Jul-07 13:36
Mike Dimmick6-Jul-07 13:36 
GeneralRe: sql query Pin
Laxmi R8-Jul-07 19:54
Laxmi R8-Jul-07 19:54 
AnswerRe: sql query Pin
N a v a n e e t h9-Jul-07 0:36
N a v a n e e t h9-Jul-07 0:36 
QuestionSQL Server 2000 - nested / recursive triggers? Pin
nr1b6-Jul-07 3:44
nr1b6-Jul-07 3:44 
AnswerRe: SQL Server 2000 - nested / recursive triggers? Pin
N a v a n e e t h9-Jul-07 0:41
N a v a n e e t h9-Jul-07 0:41 
Questionneed query for date....................... Pin
HemMagesh6-Jul-07 2:15
HemMagesh6-Jul-07 2:15 
AnswerRe: need query for date....................... Pin
Pete O'Hanlon6-Jul-07 4:12
mvePete O'Hanlon6-Jul-07 4:12 
GeneralRe: need query for date....................... Pin
Member 38798816-Jul-07 18:28
Member 38798816-Jul-07 18:28 
Questionplz give answer Pin
help as an alias5-Jul-07 23:25
help as an alias5-Jul-07 23:25 

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.