Viewing 15 posts - 76 through 90 (of 196 total)
Paarthasarathy (2/10/2010)
but the query does not work for this sample data..
insert into emp values(1,'CCCCC',10000,'abc','01/01/2005','n')
insert into emp values(1,'CCCCC',10000,'xys','01/11/2005','n')
insert into emp values(1,'CCCCC',20000,'xyz','01/01/2006','n')
insert into emp values(1,'CCCCC',20000,'xyy','01/01/2008','y')
i need this employee to get returned...
February 10, 2010 at 7:45 am
@Paarthasarathy: can it be there is an error in your sample data? The employees with ename AAAAA and BBBBB both have eid 1.
To test my solution, I changed the...
February 10, 2010 at 7:36 am
Maybe I'm missing something but could it be as simple as this?
SELECT *
FROM emp
WHERE act = 'y'
...
February 10, 2010 at 7:24 am
Try this
DECLARE @TodaysDate Date
DECLARE @TomorrowsDate Date
SET @TodaysDate = '20100214'
SET @TomorrowsDate = DATEADD(dd,1,@TodaysDate)
February 10, 2010 at 7:17 am
Adi Cohn-120898 (2/10/2010)
Lynn Pettis (2/10/2010)
I ran the following: select convert(datetime, '8/12/1430' , 131) and it returned 2009-11-25 00:00:00.000. Is that correct?
Unfortunately I have to admit that I was wrong....
February 10, 2010 at 7:07 am
PH,
You're welcome and thank you for your feedback.
I do recommend you reconsidering the design of your datamodel... If you explain why you think you need this construction, we may help...
February 10, 2010 at 7:03 am
Grant Fritchey (2/10/2010)
wschampheleer (2/10/2010)
Thank you for the compliment.
Unfortunately, I believe your new version is no improvement: you still need to insert the old ID if you want to retrieve it...
February 10, 2010 at 6:55 am
pink_panther,
Thank you for the compliment.
Unfortunately, I believe your new version is no improvement: you still need to insert the old ID if you want to retrieve it using the OUTPUT...
February 10, 2010 at 6:45 am
What version of SQL Server are you using?
In SQL 2008 you have a date data type with a range of 0001-01-01 through 9999-12-31 (January 1, 1 A.D. through December 31,...
February 10, 2010 at 5:15 am
if you go for the above solution, you'll need to do some extra work afterwards. Here's why.
February 10, 2010 at 5:09 am
Don't have access to SQL2K anymore 🙂 but try the view sys.triggers and look for the column modify_date.
February 10, 2010 at 4:57 am
You'll probably get some remarks on the quality of this design, but I'll skip that and just try to answer your question.
You could do something like this
SELECT * --...
February 10, 2010 at 4:23 am
First thing to check is whether the statistics are updated on your SQL Server 2005 machine.
If they are OK, you should compare the execution plans on both servers (if you...
February 10, 2010 at 4:08 am
You could rewrite your query to return 1 row per year (instead of different columns) with one column that holds the year and one that holds the value.
e.g.
col1 col2 col3...
February 10, 2010 at 3:18 am
Viewing 15 posts - 76 through 90 (of 196 total)