Viewing 15 posts - 5,581 through 5,595 (of 6,036 total)
Another mistake in your trigger:
You check IF EXISTS ... and insert whole set of lines, even not al of them are in this EXIST set.
It should be like this:
Insert Into...
February 21, 2006 at 6:38 pm
Agree with Daryl.
If you code any knowledge you definitely do something wrong.
You need to put all values in database and reference it in your code.
February 21, 2006 at 2:47 pm
It's even more simple than you can imagine:
Logout - Login
If you need it for presentation purposes:
convert(varchar(8), Logout - Login, 108)
February 21, 2006 at 2:13 pm
And actually it's not right.
It's good for partial year calculations (say, 75.3 year) not for days.
Right one is here:
Select DateBirth, cast (Years as varchar(3)) + ' Years, '
+ cast(Months +...
February 20, 2006 at 8:20 pm
Full script I used for my test:
DECLARE @Table TABLE (
Datebirth datetime )
INSERT INTO @Table
SELECT '1950-02-21'
Select Getdate(), DateBirth, AGE, cast (datepart(YY, AGE)-1900 as varchar(3)) + ' Years, '
+ cast(datepart(mm,...
February 20, 2006 at 7:58 pm
You need another table:
JobTitle, Paycode.
Record known relations between those entities into this table and use it in your join.
February 20, 2006 at 7:24 pm
Same script but no loops:
SELECT CourseID, LongTitle, SUBSTRING(CourseDesc, 1, 50), 0, '', 19000101, 19000101
FROM dbo.Course C
INNER JOIN @CourseDescArray A on C.CourseDesc LIKE '%'+A.Element+'%'
GROUP BY CourseID, LongTitle, SUBSTRING(CourseDesc, 1, 50)
February 20, 2006 at 6:40 pm
Check out "STR function" in BOL
February 20, 2006 at 5:49 pm
Select Getdate(), DateBirth, AGE, cast (datepart(YY, AGE)-1900 as varchar(2)) + ' Years, '
+ cast(datepart(mm, AGE)-1 as varchar(2) ) + ' Months, '
+ cast(datepart(dd, AGE)-case when DateBirth < '2000-03-01'...
February 20, 2006 at 2:46 pm
Sorry, I was looking on another your formula.
![]()
February 20, 2006 at 2:58 am
Add computed column "ShiftNo" to you column and calculate shift number from time recorded.
Then you can apply
GROUP BY ShiftNo.
February 19, 2006 at 2:44 am
And you formula returns 1 Monday between '2005-02-19' and '2006-02-20' and between '2006-02-20' and '2006-02-21'.
This Monday is included in both periods. Sounds not right.
February 19, 2006 at 12:12 am
Viewing 15 posts - 5,581 through 5,595 (of 6,036 total)