Viewing 15 posts - 1 through 15 (of 33 total)
Try this
SELECT DAY(DATEADD(d, -DAY(DATEADD(m,1,@Date)),DATEADD(m,1,@Date))) AS 'Last day of the month'
September 4, 2009 at 8:04 am
try this one.
SELECT ITEMNMBR, ITEMDESC, ABCCODE, UOMSCHDL, CurrentMonth,
QtyOnOrder, SafetyStock, QtyOnHand, Planning_Lead_Time, Supplier, PLANNINGLEADTIME, This_Month,
SUM(Month6) * - 1 Month6,
SUM(Month5) * - 1 Month5,
SUM(Month4) * - 1 Month4,
SUM(Month3)...
August 25, 2009 at 8:32 am
try this:
convert(char(10),convert(datetime, 'jul 5 2009 12:00 AM'),101)
August 3, 2009 at 6:41 am
select Substring(Name,CHARINDEX(' ', Name)+1,34)
June 17, 2009 at 9:35 am
Create project by using Integration Service Package in Visual Studio 2005. Import it into SSIS and add to your job.
June 17, 2009 at 9:21 am
select distinct stuff((select ',' + Rtrim(name) from Your_Table where id=1 FOR XML PATH('')),1, 1,'')name
June 17, 2009 at 9:09 am
Create procedure [dbo].[ftp_UploadFile]
@FTPServervarchar(128) ,
@FTPUservarchar(128) ,
@FTPPWDvarchar(128) ,
@FTPPathvarchar(128) ,
@FTPFileNamevarchar(128) ,
@SourcePathvarchar(128) ,
@SourceFilevarchar(128) ,
@workdirvarchar(128)
as
/*
exec s_ftp_PutFile
@FTPServer = 'myftpsite' ,
@FTPUser = 'username' ,
@FTPPWD = 'password' ,
@FTPPath = '/dir1/' ,
@FTPFileName = 'test2.txt' ,
@SourcePath = 'c:\vss\mywebsite\' ,
@SourceFile...
April 16, 2008 at 9:27 am
USE Northwind
SELECT ProductName FROM Products WHERE CategoryID IN
(SELECT distinct CategoryID
FROM Categories Where CategoryName = 'Beverages')
1. Products table doesnot have CategoryName
2. Always put distinct in subquery.
March 7, 2008 at 12:54 pm
Won't be easy to exclude identity column from insert statement?
existing table T1 (ID [int] IDENTITY(1,1) NOT NULL,
A1 varchar(50),A2 varchar(50),A3 varchar(50)......)
insert into T1 (A1,A2,A3,...)
select B1,B2,B3,... from T2
March 7, 2008 at 6:44 am
Thanks a lot. It works
October 19, 2007 at 6:34 am
insert into has to be from exsiting table.
get any existing table, select 2 fields and hardcode it.
Insert into #check
select 1 Column1, default Column1 from tbl1
October 18, 2007 at 7:53 am
Thank you All, I solve the problem.
select da.ID, da.Date,
(select sw1.HRS_WKLY from SAL_WKLY sw1 where sw1.ID = da.ID...
July 27, 2007 at 12:33 pm
it returs 3 records for the same date
ID Date hrs_wkly sal_wkly
---------- ---------- ----------
1 03/15/2007 25 300.00
1 03/15/2007 30 500.00
1 03/15/2007 35 700.00
July 26, 2007 at 10:36 am
you forgot to add where [D].id=[W].id
It returns only 1 row (06/01/07).
July 26, 2007 at 9:44 am
Viewing 15 posts - 1 through 15 (of 33 total)