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...
_____________
Code for TallyGenerator
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.
_____________
Code for TallyGenerator
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)
_____________
Code for TallyGenerator
February 21, 2006 at 2:13 pm
REPLACE (<ColName>, CHAR(0), '')
_____________
Code for TallyGenerator
February 21, 2006 at 2:09 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 +...
_____________
Code for TallyGenerator
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,...
_____________
Code for TallyGenerator
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.
_____________
Code for TallyGenerator
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)
_____________
Code for TallyGenerator
February 20, 2006 at 6:40 pm
Check out "STR function" in BOL
_____________
Code for TallyGenerator
February 20, 2006 at 5:49 pm
Sorry, forgot to remove "@"
_____________
Code for TallyGenerator
February 20, 2006 at 4:35 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'...
_____________
Code for TallyGenerator
February 20, 2006 at 2:46 pm
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.
_____________
Code for TallyGenerator
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.
_____________
Code for TallyGenerator
February 19, 2006 at 12:12 am
What about server collation?
_____________
Code for TallyGenerator
February 18, 2006 at 11:54 pm
Viewing 15 posts - 5,581 through 5,595 (of 6,036 total)