Viewing 11 posts - 1 through 11 (of 11 total)
One more option (may not be the best but it works).
create table #temp(Person nvarchar(50),TrnDt date, StartDt date, EndDt date,In_Punch time, Out_Punch time,WkHours int, PayCode nvarchar(50),[XFlag] int)
insert#temp([Person],[TrnDt],[StartDt],[EndDt],[In_Punch],[Out_Punch],[WkHours],[PayCode])
SELECT...
September 3, 2015 at 1:23 pm
You can't create a local SQL Server as a linked server and secondly whichever databases are accessed within DB4 (and if they are not on this server) then you need...
July 30, 2015 at 12:53 pm
Have you tried Maintenance Plans in SSMS.
In SSMS
Connect to server
Go to Management
Right Click on Maintenance Plans
Click Maintenance Plan Wizard
You can create a maintenance plan and assign a schedule to...
July 30, 2015 at 12:48 pm
Consider this idea (if not already considered). It is my experience in dealing with such data:
In these situations, the data quality plays a major role. First objective is to establish...
July 16, 2015 at 9:56 am
Try this
WITH DepTree (referenced_id, referenced_name, referencing_id, referencing_name, NestLevel, obj_type )
AS
(
SELECT
o.[object_id] AS referenced_id ,
o.name AS referenced_name,
o.[object_id] AS referencing_id,
o.name AS referencing_name,
0 AS NestLevel,
(CAST(o.[type] COLLATE Latin1_General_CI_AS_KS_WS...
July 16, 2015 at 8:07 am
Try this SQL. If you are sure that there always be a city info then replace LEFT with INNER.
selectord.ID,ord.OrderNumber,src.MarketCenterCity as 'SourceMKT', dst.MarketCenterCity as 'DestMkt'
fromOrders ord
LEFT JOIN marketCity src on ord.SrceMktId...
June 12, 2015 at 10:13 am
Here is one solution. It solves your problem:
create table #testdata(MyId int, DailyDt date, MyAmount money)
create table #timeseries(SeriesDate date)
declare @startDt date, @EndDt date, @workDt date
select@startDt = '01/05/2014', @EndDt = '01/10/2015'
select@workDt =...
April 27, 2015 at 1:23 pm
Try this.
create function dbo.[F_GetPreviousDayAndAmount] (@ID char(5),@InjectedDate datetime)
RETURNS [float]
as
BEGIN
declare @YesterdayAmount float ,@PrevDate datetime
select@PrevDate = max(InjectedDate)
from[dbo].[Transactions]
where[ID] = @ID and
[InjectedDate] < @InjectedDate
if @PrevDate is NULL
select@YesterdayAmount = NULL
else
begin
select@YesterdayAmount = [Amount]
from[dbo].[Transactions]
where[ID] = @ID and
[InjectedDate]...
March 31, 2015 at 1:39 pm
First you don't have to convert the getdate() in any format. See the following example:
declare @a date
select @a = '2012-10-22'
if @a > GETDATE()
select 111
else
select...
March 30, 2015 at 2:12 pm
Viewing 11 posts - 1 through 11 (of 11 total)