Viewing 15 posts - 2,341 through 2,355 (of 3,543 total)
Not aware of a function, per se but you could try this
SELECT CASE WHEN PATINDEX('%[^0-9]%',[Input])>0
THEN LEFT([Input],PATINDEX('%[^0-9]%',[Input])-1)
ELSE [Input]
END
March 14, 2005 at 7:24 am
Always best done in presentation (app) but if you truly want to do it in sql then
DECLARE @maxemp int, @maxman int, @count int,@managerid int, @sql varchar(1000)
SELECT @maxemp = COUNT(DISTINCT...
March 11, 2005 at 7:41 am
SELECT t1.EmpID, t1.PayCode, t1.PayAmt, t2.PayCode, t2.PayAmt
FROM #table t1
INNER JOIN #table t2
ON t2.EmpID = t1.EmpID
AND t2.PayCode = 2
AND t2.PayAmt <> (t1.PayAmt * 1.5)
WHERE t1.PayCode =...
March 11, 2005 at 7:21 am
It does not matter if OpeningDate is NULL or '', CONVERT will not produce the error (you will get NULL for NULL date and '1900-01-01' for '')
The error is due...
March 11, 2005 at 6:03 am
Search the Internet there is a lot about this.
This may help
http://www.dbazine.com/celko1.html
This is lifted from a page on the Internet
DivideBy:
You may also perform a set division operation on two tables....
March 11, 2005 at 3:08 am
mmmm different
Nice deviation from the norm
DIVIDEBY is not a SQL operator or command, it is algebra
I...
March 11, 2005 at 2:49 am
Duplicate post.
See http://www.sqlservercentral.com/forums/shwmessage.aspx?forumid=8&messageid=166820
March 10, 2005 at 7:19 am
Not sure if this is what you want. It all depends on what you want to do with the data from the additonal tables.
LEFT OUTER JOIN E__EMPLOYEE e
ON [result].EMPLOYEEID...
March 10, 2005 at 6:33 am
Yes, if there is no space then it makes it difficult to split. There is another thread on this forum that discusses this topic and I think it assumes that the...
March 9, 2005 at 5:28 am
SELECT LEFT(@postcode,CHARINDEX(' ',@postcode)-1)
March 9, 2005 at 5:00 am
Phill is right you will have to use either a string or a variable you cannot use another column in CONTAINS.
The error is in the first line as not tablename...
March 8, 2005 at 7:33 am
The use of float aside, I think there is a problem with your statement.
If you are converting numeric(5,1) to float then you will get either an exact value or an...
March 8, 2005 at 7:11 am
A bit late, but....
SELECT LEFT(@inputstring,PATINDEX('%[0-9]%',@inputstring)-1)
March 8, 2005 at 6:29 am
I can't get it to work at all
March 8, 2005 at 5:13 am
Jeff,
Nice solution if it was possible. As stated in BOL (SQL2K SP3) and in practice escaping double quotes (\") is not allowed with BCP.
March 8, 2005 at 2:29 am
Viewing 15 posts - 2,341 through 2,355 (of 3,543 total)