Viewing 15 posts - 25,111 through 25,125 (of 26,490 total)
There is a side note to the cursor solution, each pass (a single record from the restrictions table) is applied to the inventory records in a set based fashion. ...
March 10, 2008 at 9:54 pm
Well, unfortunately, I do know of a case where a cursor is the best option (at least at the time). Last employer we had a restrictions table for documents...
March 10, 2008 at 9:11 pm
I have to agree with Jack. Use the correct data type for the correct data element. I agree, unless you really need to record the time of birth,...
March 10, 2008 at 9:01 pm
Cursors may be evil, but they may be a necessary evil. Where possible use set based solutions, but sometimes you may find cursors are necessary, and therefore knowing how...
March 10, 2008 at 3:26 pm
Jeff Moden (3/10/2008)
Lynn Pettis (3/10/2008)
SELECT @startdate = CAST('2007' AS DATETIME)
SELECT @enddate = DATEADD(yy,1,CAST('2007' AS DATETIME)) - 1
I...
March 10, 2008 at 3:06 pm
There is possibly an error report somewhere (no I don't know where or its name other than it probably ends in the extension of .txt).
One possiblity here from what I...
March 10, 2008 at 2:59 pm
Could you provide the full text of the error message? With all ...'s it is hard to know what the error actually is.
Thanks
😎
March 10, 2008 at 2:34 pm
DECLARE @ConsultantID VARCHAR(20)
DECLARE @StartDate datetime
DECLARE @EndDate datetime
DECLARE @Year CHAR(4)
SET @ConsultantID = '0000003'
SET @StartDate = NULL
SET @EndDate = NULL
SET @Year = 2007
-- IF @Year <> NULL
-- ...
March 10, 2008 at 2:12 pm
The people you know who celebrate their birthdays on Feb 28 on non-leap years, doesn't mean the state or country they live in says they are another year older yet....
March 10, 2008 at 2:06 pm
Jeff, since the OP wants the end of the year wouldn't you want this:
SELECT @startdate = CAST('2007' AS DATETIME)
SELECT @enddate = DATEADD(yy,1,CAST('2007' AS DATETIME)) - 1
I know why you do...
March 10, 2008 at 1:52 pm
If there is a way to do this without comparing months and day, I just can't find on my and I haven't the energy to search all these posts. ...
March 10, 2008 at 1:29 pm
GSquared, don't think so. Please doupbe check this code snippet to be sure I have your code right:
declare @dob datetime,
@calcDate datetime
set...
March 10, 2008 at 1:08 pm
How about this:
datediff(yy, @dob, @calcDate) - case when (@calcDate < dateadd(yy, datediff(yy, @dob, @calcDate), @dob)) then 1 else 0 end as AgeInYears
Tests:
declare @dob datetime,
...
March 10, 2008 at 1:00 pm
I did say appears to work. That was the leap year test I was missing. thanks
😎
March 10, 2008 at 12:47 pm
Viewing 15 posts - 25,111 through 25,125 (of 26,490 total)