Viewing 15 posts - 526 through 540 (of 1,182 total)
Yes, we all know too well that sometimes the hardest problem we work on is right in front of our face. :hehe:
April 30, 2008 at 1:20 pm
You're close ...
select count(*) as employeeCnt from foo
April 30, 2008 at 1:11 pm
If the target table has an identity column defined, then don't include it in your insert statement and it will be automatically populated at the time of insert.
April 30, 2008 at 1:05 pm
Grant Fritchey (4/29/2008)
It sure beats working on a nuclear powered submarine in terms of pay, benefits, hours, cleanliness... Yeah, I'd say it's still a good career.
Jeff Moden (4/29/2008)
April 30, 2008 at 9:12 am
You can't do that type of conditional logic in views. Study up on stored procedures. 😀
April 29, 2008 at 8:37 am
then just change the CTE to a temp table. 😀
CREATE TABLE #pridLimits (prid VARCHAR(55), minDate DATETIME, maxDate DATETIME)
INSERT #pridLimits
SELECT
...
April 29, 2008 at 8:07 am
Karthik,
Take a look at this. It does what you want. See if you understand it, and if you should have any questions, I'd be happy to answer them... 😀
DECLARE @NullPform...
April 29, 2008 at 7:39 am
OOPS, you need to add in a zero, for the date selected to show up...
WITH mData
AS (SELECT
DATEDIFF(DAY,date_enrolled,'4/16/2008') AS dayNumber,
...
April 28, 2008 at 2:24 pm
Set up test data ...
DECLARE @booksdata TABLE
(date_enrolled [datetime],
book_name varchar(50),
author_name varchar(100),
book_visited float)
...
April 28, 2008 at 2:21 pm
Can there be more than one book_visted for one enrolled_date, or is that a count? Is there a maximum number of days they can select?
April 28, 2008 at 1:56 pm
Please post your CREATE TABLE statement and some sample data (in the form of an INSERT statement) so we can help you more effectively. 😀
April 28, 2008 at 1:19 pm
Karthik,
What is it that you are trying to accomplish? I understand that you want to go "Set Based", but what is the goal of the procedure?
April 28, 2008 at 9:28 am
ABC will never equal NULL.
you'd need to rewrite it. One possibility is
SELECT
...
WHERE
(ABC IS NULL AND @abc = '')
...
April 28, 2008 at 7:59 am
Since you have 2 instances of that column, you need to tell SQL which one to order by ..
select distinct a.cwono , a.dorder, a.drequest, a.lhold, a.csono, a.ccustno
from miword...
April 23, 2008 at 12:14 pm
chinna (4/23/2008)
April 23, 2008 at 8:48 am
Viewing 15 posts - 526 through 540 (of 1,182 total)