Viewing 15 posts - 12,406 through 12,420 (of 15,381 total)
umm....you have to exec your dynamic sql before you can get results. All you have done is build a string and then select it.
April 16, 2012 at 11:25 am
sqlbi.vvamsi (4/16/2012)
CREATE TABLE [dbo].[test](
[a] [numeric] NULL,
[date] NULL
) ON [PRIMARY]
GO
ab
11981-08-14
21985-10-03
32012-04-13
select SUM(a) from test group by b having b=CONVERT(date,GETDATE())--This returns nothing
select SUM(a) from test where b=CONVERT(date,GETDATE())--This returns...
April 16, 2012 at 10:22 am
Keep in mind that returning null is a row. When your query finds no rows like in your example it can't return null because it did not return any rows....
April 16, 2012 at 10:08 am
hbtkp (4/16/2012)
i just want to know ,how you select max (date)max is not working as date is datetime
Define not working. Did it return the wrong value? Did it return...
April 16, 2012 at 10:02 am
hbtkp (4/16/2012)
NUMBER CUMULATIVE
...
April 16, 2012 at 9:05 am
Eugene Elutin (4/16/2012)
Sean Lange (4/13/2012)
There were two crocodiles flying. One to the south but another one was blue.
Question:...
April 16, 2012 at 8:58 am
Gabe T. (4/13/2012)
You probably need a string splitter and an unpivot. let me see what I can come up with.
Look at the splitter in my signature.
Depending on some details from...
April 13, 2012 at 3:26 pm
I do not think you need a loop to do this at all. If you can post ddl and sample data (insert statements) along with desired output based on your...
April 13, 2012 at 3:09 pm
L' Eomot Inversé (4/13/2012)
Jeff Moden (4/13/2012)
capn.hector (4/13/2012)
April 13, 2012 at 2:48 pm
parameter sniffing? cached plans? stale statistics? Could be any of those. From your brief description it sounds like a "catch all" type of query. Take a look at Gail's blog...
April 13, 2012 at 1:36 pm
GilaMonster (4/13/2012)
Lynn Pettis (4/13/2012)
GilaMonster (4/13/2012)
Someone to keep an eye on: http://www.sqlservercentral.com/Forums/UserInfo953430.aspxAny particular reason or just general principles?
Just a feeling. Vagueish questions, little response to replies...
Not saying there's a problem, but...
April 13, 2012 at 1:30 pm
Evil Kraig F (4/13/2012)
capn.hector (4/13/2012)
April 13, 2012 at 12:58 pm
zojan (4/13/2012)
Sean Lange (4/13/2012)
jzoran (4/13/2012)
April 13, 2012 at 12:27 pm
jzoran (4/13/2012)
April 13, 2012 at 11:59 am
Viewing 15 posts - 12,406 through 12,420 (of 15,381 total)