Viewing 15 posts - 11,281 through 11,295 (of 13,861 total)
It's not easy to understand what you are asking - can you provide sample input data, with desired output?
June 24, 2011 at 2:05 am
GilaMonster (6/23/2011)
The first there's a function applied to the column. That makes the predicate non-SARGable, meaning SQL can NEVER use an index seek operation...
June 23, 2011 at 11:21 am
As you are looking from the start of the column, you can use this
WHERE LEFT(fldField,3) = 'NCB'
- just a little tidier and avoids wildcards.
June 23, 2011 at 9:58 am
Here is proof that "it works"
DECLARE @a CHAR(1) = CHAR(10)
SELECT @a, ASCII(@a), REPLACE(@a,CHAR(10),' '), ASCII(REPLACE(@a,CHAR(10),' '))
Now please try to explain how your problem is different from what has been suggested.
June 23, 2011 at 9:40 am
How large is 'large'? Do you want to do this internally (ie, using your own network/Exchange infrastructure), or use a third party (which you might, if large really is LARGE)?
June 23, 2011 at 1:48 am
Try something like this:
DECLARE @a VARCHAR(20) = '010711'
SELECT @a,
'20' + RIGHT(@a, 2) + SUBSTRING(@a, 3, 2) + LEFT(@a, 2)
June 22, 2011 at 5:34 am
Jnrstevej (6/22/2011)
I'm trying to format the column(dueDate) which contains the date to a YYYYMMDD format
My understanding to achieve this would be
select convert(varchar,getdate(),112)
select CONVERT(date,duedate,112)
from test
--my attempt
select convert(varchar,duedate,112
from test
--Test table...
June 22, 2011 at 5:30 am
Nasty.
I've thought about the logic a little & this might work:
If @StartDay <= @EndDay then
where Day(Birthdate) Between @StartDay and @EndDay
else
where Day(Birthdate) Not Between @StartDay and...
June 22, 2011 at 2:30 am
Sachin4all (6/21/2011)
select utid,date,time
from time t
where transactiontime between ? and ?
I have created the varibles startdate and enddate as datetime
Sourcetype as directinput...
June 21, 2011 at 1:01 pm
You asserted it was okay to ommit readability because it's got no technical function in the post I replied to. I'm pointing out that that's specious.
You continue to infer things...
June 21, 2011 at 8:46 am
I created your table, populated the data and then
SELECT * FROM dbo.Onhand o
- there is no right-alignment of anything.
How are you getting the data out of SQL Server and into...
June 21, 2011 at 7:07 am
No, I read your message correctly. What I disagree with is "...consider doing yourself a favor and omit the readability word...". Yes, it's only in there to make the written...
June 21, 2011 at 6:59 am
Jnrstevej (6/21/2011)
To be honest i don't understand the script below, this returns 32 for me.
declare @name varchar(256)
set @name = ' 1231'
select ascii(SUBSTRING(@name , 1 , 1))
I...
June 21, 2011 at 6:12 am
aaa-322853 (6/21/2011)
June 21, 2011 at 5:46 am
Adding to that, trim removes spaces, so the characters to the left that you wish to remove must be something else. Step 1 is to find out what those characters...
June 21, 2011 at 4:49 am
Viewing 15 posts - 11,281 through 11,295 (of 13,861 total)