Viewing 15 posts - 25,111 through 25,125 (of 26,484 total)
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
Here is a formula that appears to work okay in SQL Server:
datediff(yy, @dob, @calcDate) - case when (datepart(dy, @calcDate) < datepart(dy, @dob)) then 1 else 0...
March 10, 2008 at 12:28 pm
I will add this to the issue at my previous employer: it was an inherited system (was supported by an outside company and brought internal) that was written entirely in...
March 10, 2008 at 10:15 am
If discounts have to be applied in a specific order, it does add to the complexity. Ten percent off of ten percent off, is not twenty percent off:
x =...
March 10, 2008 at 8:57 am
Cursors may be evil, but they are sometimes a necessary evil. I have seen where a cursor based solution out performed a set based solution. Having learned more...
March 10, 2008 at 8:37 am
Jeff Moden (3/7/2008)
I'll throw in that just from a code consistency standpoint, WHERE IN should be rewritten to a normal INNER JOIN like Lynn wrote it.
Thanks, Jeff. You should...
March 7, 2008 at 1:14 pm
The subquery is identifying the CategoryID for the specified CategoryName, 'Beverages', so that the main query only returns products for that specified category.
Another way to write that query is as...
March 7, 2008 at 12:56 pm
Viewing 15 posts - 25,111 through 25,125 (of 26,484 total)