Thursday, May 16, 2013

[T-SQL] Query two different Servers

[T-SQL] Query two different Servers


Query two different Servers

Posted: 16 May 2013 12:33 AM PDT

Is there a way to query two different servers at the same time if they aren't linked?

Selecting DISTINCT

Posted: 15 May 2013 11:50 PM PDT

I have three fields I am interested in:Employee_ID,Employee_Title,Employee_EntryI want to be able to select these three fields but only the record with the most recent Employee_Entry date. In some cases an Employee may have moved job titles and have several entries against the Employee_ID.I have started with something like this:SELECT DISTINCTEmployee_ID,Employee_Title,Employee_EntryFROM emp.employeesI have tried using Max(Employee_Entry) but this returns all records for those who have multiple titles. I just want the current most recent Employee_title.

Intelisense is not working !!! Even After trying everything mention on msdn website

Posted: 15 May 2013 11:44 PM PDT

Hi all Experts,I am trying this since a long time. My intellisense is not working with a specified [b]Database[/b]. Intellisense i working for all other Database except one. I tried all the things that were told in this article http://blog.sqlauthority.com/2009/03/31/sql-server-2008-intellisense-does-not-work-enable-intellisense/ .Does any body know that how to enable the intellisense at Database Level.

Help with Round to the nearest two decimals

Posted: 15 May 2013 01:31 PM PDT

Dear friends,I need to do a urgent requirement-I'm facing issues with rounding the duration to a whole number. The new requirement is: Calculate as (Job Posting End Date - Job Posting Start Date)/30. Round to the nearest two decimals. OR Calculate as (Work Order End Date - Work Order Start Date)/30. Round to the nearest two decimals. So per this updated requirement:- if the calculation came to 20.42, it should display as 20.42- if the calculation came to 20.4789, it should display as 20.48- if the calculation came to 20.4739, is should display as 20.47- if the calculation came to 20.1234, it should display as 20.12BUT my code is- CAST(floor(datediff(d, [WorkForce_JobPosting].[Job Posting Start Date_JP], [WorkForce_JobPosting].[Job Posting End Date_JP]) / 30) AS INT)and is not working it's giving me the above results.Need help please.ThanksDhananjay

No comments:

Post a Comment

Search This Blog