Viewing 15 posts - 451 through 465 (of 466 total)
The ^ sign at the beginning of the square brackets means not these characters. So where Last_Name like %[^a-z]% means find all last names that have any character that...
January 16, 2012 at 9:54 am
samvanga's method will get you the names that only have numerics in them if that is what you want. You would also only need the first statement in the...
January 16, 2012 at 9:52 am
select * from yourTable
where Last_Name like '%[^a-z]%'
However, this will include names with spaces in them as well, which you may also have. If you don't want those included, you...
January 16, 2012 at 9:39 am
Strange. Something like this should convert your whole column then if that is the case.
select convert(datetime, nullif(yourCol, 'NULL'))
January 13, 2012 at 3:18 pm
What is the code you are running? When I run this
select CONVERT(datetime, '25-Apr-84')
I get the result 1984-04-25 00:00:00.000. Is that not what you want?
January 13, 2012 at 3:03 pm
No problem, just be careful if daylight savings time is involved here. 6 hours difference from UTC on a time in January may not be the same thing you...
January 5, 2012 at 3:21 pm
If I am understanding this the way I should be then should you just need something like this
DATEADD(hh, -6, UTCOccurrenceDateTime) >= DATEADD(day, DATEDIFF(day, 0, GETUTCDATE()), 0)
after the AND in your...
January 5, 2012 at 2:59 pm
It's hard to help with the code you have posted. In your first example Column1 looks like a date column. In your second example it looks like you...
January 5, 2012 at 1:33 pm
I just did something very similar this morning. I was combining emails from team members into one column having them separated by commas. I used the xml.value command...
January 4, 2012 at 2:18 pm
;with rowCte as
(
select *, row_number() over (partition by store_name order by store_name) [num]
from allStores
)
select case when num = 1 then storeName else '' end storeName, storeAddress
from rowCTE
Something like that? ...
January 3, 2012 at 5:00 pm
This is pretty vague. Perhaps you should lookup the WHERE clause?
January 3, 2012 at 4:44 pm
Thanks Paul, I haven't made it through the comments in that article yet, but I will be sure to read through them. That error came from me switching the...
December 30, 2011 at 7:59 am
Cometav, perhaps this will help you.
Drew and/or others, I would appriciate any feedback on this method.
After reading Jeff Moden's article that Drew suggested (which was straightforward and very helpful), I...
December 29, 2011 at 10:56 am
Thanks Drew, I will check out that article. I am pretty new to SQL Server myself and that method was the first thing that popped into my head.
I am...
December 29, 2011 at 9:14 am
Select top 80 percent * from <sometable>
will get you 80 percent of the total number of records. Since you have 9 records in the table you show, it returns...
December 29, 2011 at 8:41 am
Viewing 15 posts - 451 through 465 (of 466 total)